|
@@ -85,6 +85,7 @@ class OrderImport extends Base
|
|
|
'orderCode' => '',
|
|
|
'page' => 1,
|
|
|
'size' => 15,
|
|
|
+ 'company_name' => ''
|
|
|
], 'post', 'trim');
|
|
|
|
|
|
$where = [['c.is_del', '=', OIFCModel::$is_del_normal]];
|
|
@@ -96,6 +97,7 @@ class OrderImport extends Base
|
|
|
if ($param['addtime_start'] && $param['addtime_end']) $where[] = ['c.addtime', 'between', [$param['addtime_start'], $param['addtime_end']]];
|
|
|
if ($param['plat_code']) $where[] = ['c.plat_code', 'like', '%' . $param['plat_code'] . '%'];
|
|
|
if ($param['orderCode']) $where[] = ['c.orderCode', 'like', '%' . $param['orderCode'] . '%'];
|
|
|
+ if ($param['company_name']) $where[] = ['c.createrid', 'in', get_company_item_user_by_name($param['company_name'])];
|
|
|
|
|
|
$total = OIFCModel::alias('c')
|
|
|
->leftJoin('good_platform gp', 'gp.plat_code=c.plat_code AND gp.is_del=0')
|
|
@@ -104,11 +106,16 @@ class OrderImport extends Base
|
|
|
->count('c.id');
|
|
|
|
|
|
$list = OIFCModel::alias('c')
|
|
|
- ->field('c.*,g.good_name,p.platform_name platform_title')
|
|
|
+ ->field('c.*,g.good_name,p.platform_name platform_title,u.itemid')
|
|
|
->leftJoin('good_platform gp', 'gp.plat_code=c.plat_code AND gp.platform_code=c.platform_id AND gp.is_del=0')
|
|
|
->leftJoin('good g', 'g.spuCode=gp.spuCode AND g.is_del=0')
|
|
|
->leftJoin('platform p', 'p.id=c.platform_id AND p.is_del=0')
|
|
|
+ ->leftJoin("depart_user u", "u.uid=c.createrid AND u.is_del=0")
|
|
|
->where($where)
|
|
|
+ ->append(['company_name'])
|
|
|
+ ->withAttr('company_name', function ($val, $data) {
|
|
|
+ return implode('/', array_column(GetPart($data['itemid']), 'name'));
|
|
|
+ })
|
|
|
->page($param['page'], $param['size'])
|
|
|
->order('id', 'desc')
|
|
|
->select()
|