fixbug orders.notify_file_list, owners.biz_id, owners.admin_id

This commit is contained in:
qianhy
2022-12-01 16:41:42 +08:00
committed by lccsw
parent 613cbbf1c4
commit a7fa3035ff
2 changed files with 21 additions and 5 deletions
+20 -4
View File
@@ -141,10 +141,26 @@ class Owners extends HD_Controller
$map_attrs = $this->mdAttr->map('id', 'title', ["id in({$str_v_ids})" => null]);
$str_county_ids = implode(',', array_unique(array_column($res, 'county_id')));
$map_countys = $this->mdArea->map('county_id', 'city_name,county_name', ["county_id in({$str_county_ids})" => null]);
$str_biz_ids = implode(',', array_unique(array_column($res, 'biz_id')));
$map_bizs = $this->mdBiz->map('id', 'biz_name', ["id in({$str_biz_ids})" => null]);
$str_admin_ids = implode(',', array_unique(array_column($res, 'admin_id')));
$map_admins = $this->mdLichebUsers->map('id', 'uname', ["id in({$str_admin_ids})" => null]);
#$str_biz_ids = implode(',', array_unique(array_column($res, 'biz_id')));
#$map_bizs = $this->mdBiz->map('id', 'biz_name', ["id in({$str_biz_ids})" => null]);
$arr_biz_id = array_unique(array_column($res, 'biz_id'));
foreach ($arr_biz_id as $k => $v){
if ($v == null || $v == ''){
unset($arr_biz_id[$k]);
}
}
$str_biz_ids = implode(',', $arr_biz_id);
$map_bizs = $arr_biz_id ? $this->mdBiz->map('id', 'biz_name', ["id in({$str_biz_ids})" => null]) : array();
#$str_admin_ids = implode(',', array_unique(array_column($res, 'admin_id')));
#$map_admins = $this->mdLichebUsers->map('id', 'uname', ["id in({$str_admin_ids})" => null]);
$arr_admin_id = array_unique(array_column($res, 'admin_id'));
foreach ($arr_admin_id as $k => $v){
if ($v == null || $v == ''){
unset($arr_admin_id[$k]);
}
}
$str_admin_ids = implode(',', $arr_admin_id);
$map_admins = $arr_admin_id ? $this->mdLichebUsers->map('id', 'uname', ["id in({$str_admin_ids})" => null]) : array();
foreach ($res as $key => $val) {
$mobile_sub = $val['mobile'];
$sex = $car_name = $city_name = '';
@@ -220,7 +220,7 @@ class Orders extends HD_Controller
$loan = $this->order_loans_model->get(['o_id' => $row['id']]);
$notify_file_list = [];
$file_list = explode(',',$loan['notify_file']);
$file_list = $loan['notify_file'] ? explode(',',$loan['notify_file']) : array();
if($file_list){
foreach ($file_list as $item) {
$notify_file_list[] = build_qiniu_image_url($item);