|
@@ -1013,13 +1013,14 @@ class Good extends Base
|
|
|
|
|
|
$action_uids = array_column($list, 'action_uid');
|
|
|
$action_uids = array_unique($action_uids);
|
|
|
- $item = [];
|
|
|
- foreach ($action_uids as $action_uid) {
|
|
|
- $items = Db::name("depart_user")->where('uid', $action_uid)->column("itemid");
|
|
|
- foreach ($items as $it) {
|
|
|
- $item[$action_uid][] = implode('/', array_column(GetPart($it), 'name'));
|
|
|
- }
|
|
|
- }
|
|
|
+ $item = get_company_name_by_uid($action_uids);
|
|
|
+// $item = [];
|
|
|
+// foreach ($action_uids as $action_uid) {
|
|
|
+// $items = Db::name("depart_user")->where('uid', $action_uid)->column("itemid");
|
|
|
+// foreach ($items as $it) {
|
|
|
+// $item[$action_uid][] = implode('/', array_column(GetPart($it), 'name'));
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
foreach ($list as &$value){
|
|
|
$wsm = Db::name("warehouse_info")
|
|
@@ -1040,7 +1041,7 @@ class Good extends Base
|
|
|
$value['code'] =$wsm['code'];
|
|
|
$value['name'] =$wsm['name'];
|
|
|
$value['action_type_cn'] =$this->acton[$value['action_type']];
|
|
|
- $value['item'] = isset($item[$value['action_uid']]) ? $item[$value['action_uid']] : '';
|
|
|
+ $value['item'] = $item[$value['action_uid']] ?? '';
|
|
|
$value['can'] =$int;
|
|
|
$value['company'] =$wsm['company']??'';
|
|
|
$value['companyNo'] =$wsm['companyNo']??'';
|
|
@@ -1206,17 +1207,19 @@ class Good extends Base
|
|
|
|
|
|
$list = Db::name('good_ladder')
|
|
|
->alias('gl')
|
|
|
- ->field('gl.id,gl.skuCode,gp.spuCode,p.platform_name,gb.good_thumb_img,gb.good_name,gb.cat_id,gb.good_type,gb.is_stock,gb.brand_id,gp.plat_code,gl.min_num moq,gl.sale_price,gb.creater purchase,gb.creater,gb.companyNo,u.itemid')
|
|
|
+ ->field('gl.id,gl.skuCode,gp.spuCode,p.platform_name,gb.good_thumb_img,gb.good_name,gb.cat_id,gb.good_type,gb.is_stock,gb.brand_id,gp.plat_code,gl.min_num moq,gl.sale_price,gb.creater purchase,gb.creater,gb.companyNo')
|
|
|
->leftJoin('good_platform gp', 'gp.skuCode=gl.skuCode AND gp.is_del=0')
|
|
|
->leftJoin('platform p', 'p.id=gp.platform_code AND p.is_del=0')
|
|
|
->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode AND gb.is_del=0')
|
|
|
- ->leftJoin("depart_user u", "u.uid=gb.createrid AND u.is_del=0")
|
|
|
->where($where)
|
|
|
->page($param['page'], $param['size'])
|
|
|
->order(['gl.skuCode' => 'asc', 'gl.addtime' => 'desc', 'gl.id' => 'desc'])
|
|
|
->select()
|
|
|
->toArray();
|
|
|
|
|
|
+ $all_createrid = array_column($list,'createrid');
|
|
|
+ $item = get_company_name_by_uid($all_createrid);
|
|
|
+
|
|
|
//6.补充数据,照搬list方法
|
|
|
$all_brand = Db::name('brand')
|
|
|
->where('is_del', 0)
|
|
@@ -1235,7 +1238,7 @@ class Good extends Base
|
|
|
$value['stock_total'] = Db::name("good_stock")
|
|
|
->where(['spuCode' => $value['spuCode'], "is_del" => 0])
|
|
|
->sum("usable_stock");
|
|
|
- $value['company_name'] = implode('/', array_column(GetPart($value['itemid']), 'name'));
|
|
|
+ $value['company_name'] = $item[$value['createrid']]??'';
|
|
|
}
|
|
|
|
|
|
return app_show(0, "获取成功", ['list' => $list, 'count' => $count]);
|