customer defeat only select one

This commit is contained in:
qianhy
2023-03-12 10:40:14 +08:00
committed by xiaoyu
parent 63ec49d99c
commit 0ce7aa8f0f
+8 -3
View File
@@ -403,18 +403,23 @@ class Customers extends Wxapp
}
$tag_str = '';
$tag_arr_all = array();
$tag_checked = 0; # 20230312 只要有一个选中即可
foreach ($invalid_tag as $key => $val){
$tag_name = $val['name'];
$tag_arr = [];
foreach ($val['list'] as $kt => $vt){
$vt['checked'] && $tag_arr[] = $vt['name'];
$vt['checked'] && $tag_checked = 1;
}
/*# 20230101 提示没选中的标签
if (!$tag_arr){
throw new Exception("请选择标签[{$tag_name}]", ERR_PARAMS_ERROR);
}
throw new Exception("请选择标签[{$val['name']}]", ERR_PARAMS_ERROR);
}*/
$tag_arr_all = array_merge($tag_arr_all, $tag_arr);
$tag_str .= $val['name'].': '.implode(', ', $tag_arr).'; ';
}
if (!$tag_checked){
throw new Exception("请选择至少一个标签!", ERR_PARAMS_ERROR);
}
$tag_str = implode(', ', $tag_arr_all);
$jsondata = $row['jsondata'] ? json_decode($row['jsondata'], true) : array();
$jsondata['defeat']['time'] = date("Y-m-d H:i:s");