|
@@ -968,7 +968,8 @@ class Good extends Base
|
|
|
'platform_code' => '',
|
|
|
'supplierNo' => '',
|
|
|
'page' => 1,
|
|
|
- 'size' => 15
|
|
|
+ 'size' => 15,
|
|
|
+ 'company_name'=>'',
|
|
|
], 'post', 'trim');
|
|
|
|
|
|
$where = [["gl.is_del", "=", 0], ['gp.exam_status', '=', 6]];//exam_status==6已上线
|
|
@@ -987,24 +988,27 @@ class Good extends Base
|
|
|
if (!empty($param['plat_code'])) $where[] = ['gp.plat_code', 'like', '%' . $param['plat_code'], '%'];
|
|
|
if (!empty($param['creater'])) $where[] = ['gb.creater', 'like', '%' . $param['creater'], '%'];
|
|
|
if (!empty($param['platform_code'])) $where[] = ['gp.platform_code', 'like', '%' . $param['platform_code'], '%'];
|
|
|
+ if (!empty($param['company_name'])) $where[] = ['gb.createrid', 'in', get_company_item_user_by_name($param['company_name'])];
|
|
|
// if (!empty($param['supplierNo'])) $where[] = ['supplierNo', 'like', '%'.$param['supplierNo'],'%'];
|
|
|
|
|
|
//5.获取结果
|
|
|
$count = 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,gl.sale_price,gb.creater purchase,gb.creater,gb.companyNo')
|
|
|
+ //->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,gl.sale_price,gb.creater purchase,gb.creater,gb.companyNo,u.itemid')
|
|
|
->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 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)
|
|
|
->count('gl.id');
|
|
|
|
|
|
$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')
|
|
|
+ ->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')
|
|
|
->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'])
|
|
@@ -1029,6 +1033,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'));
|
|
|
}
|
|
|
|
|
|
return app_show(0, "获取成功", ['list' => $list, 'count' => $count]);
|