|
@@ -597,6 +597,8 @@ class Report extends Base
|
|
|
'companyName' => '',
|
|
|
'start_date' => '',
|
|
|
'end_date' => '',
|
|
|
+ 'start_updatetime' => '',
|
|
|
+ 'end_updatetime' => '',
|
|
|
'page' => 1,
|
|
|
'size' => 15,
|
|
|
], 'post', 'trim');
|
|
@@ -604,6 +606,8 @@ class Report extends Base
|
|
|
$val_params = Validate::rule([
|
|
|
'start_date' => 'date|elt:end_date',
|
|
|
'end_date' => 'date',
|
|
|
+ 'start_updatetime' => 'date|elt:end_updatetime',
|
|
|
+ 'end_updatetime' => 'date',
|
|
|
]);
|
|
|
|
|
|
if (!$val_params->check($param)) return error_show(1004, $val_params->getError());
|
|
@@ -612,6 +616,9 @@ class Report extends Base
|
|
|
|
|
|
if ($param['start_date'] != '' && $param['end_date'] != '') $where[] = ['ci.addtime', 'between', [$param['start_date'] . ' 00:00:00', $param['end_date'] . ' 23:59:59']];
|
|
|
if ($param['companyName'] != '') $where[] = ['csi.companyName', 'like', '%' . $param['companyName'] . '%'];
|
|
|
+ if ($param['start_updatetime'] != '' && $param['end_updatetime'] != '') $where[] = ['ci.updatetime', 'between', [$param['start_updatetime'] . ' 00:00:00', $param['end_updatetime'] . ' 23:59:59']];
|
|
|
+
|
|
|
+ $status = [1 => '招标进行中', 2 => '招标已结束', 3 => '等待议价结果', 4 => '确认商品', 5 => '成功转单', 6 => '取消转单', 7 => '招标已暂停'];
|
|
|
|
|
|
$count = Db::name('consult_info')
|
|
|
->alias('ci')
|
|
@@ -625,7 +632,7 @@ class Report extends Base
|
|
|
|
|
|
$data = Db::name('consult_info')
|
|
|
->alias('ci')
|
|
|
- ->field('ci.zxNo,ci.good_name,ci.num,csi.companyName,ci.addtime,ci.arrival_time endtime')
|
|
|
+ ->field('ci.zxNo,ci.good_name,ci.num,csi.companyName,ci.addtime,ci.arrival_time endtime,ci.updatetime,ci.status')
|
|
|
->leftJoin('consult_bids cb', 'cb.infoNo=ci.infoNo')
|
|
|
->leftJoin('consult_order co', 'co.zxNo=ci.zxNo')
|
|
|
->leftJoin('customer_info csi', 'csi.companyNo=co.khNo')
|
|
@@ -633,6 +640,9 @@ class Report extends Base
|
|
|
->whereNull('cb.id')//未采反,即咨询单没有对应的反馈单,所以反馈单id应该是null
|
|
|
->order('ci.arrival_time', 'desc')
|
|
|
->page($param['page'], $param['size'])
|
|
|
+ ->withAttr('status', function ($val) use ($status) {
|
|
|
+ return isset($status[$val]) ? $status[$val] : '';
|
|
|
+ })
|
|
|
->select()
|
|
|
->toArray();
|
|
|
|
|
@@ -649,11 +659,15 @@ class Report extends Base
|
|
|
'companyName' => '',
|
|
|
'start_date' => '',
|
|
|
'end_date' => '',
|
|
|
+ 'start_updatetime' => '',
|
|
|
+ 'end_updatetime' => '',
|
|
|
], 'post', 'trim');
|
|
|
|
|
|
$val_params = Validate::rule([
|
|
|
'start_date' => 'date|elt:end_date',
|
|
|
'end_date' => 'date',
|
|
|
+ 'start_updatetime' => 'date|elt:end_updatetime',
|
|
|
+ 'end_updatetime' => 'date',
|
|
|
]);
|
|
|
|
|
|
if (!$val_params->check($param)) return error_show(1004, $val_params->getError());
|
|
@@ -662,16 +676,22 @@ class Report extends Base
|
|
|
|
|
|
if ($param['start_date'] != '' && $param['end_date'] != '') $where[] = ['ci.addtime', 'between', [$param['start_date'] . ' 00:00:00', $param['end_date'] . ' 23:59:59']];
|
|
|
if ($param['companyName'] != '') $where[] = ['csi.companyName', 'like', '%' . $param['companyName'] . '%'];
|
|
|
+ if ($param['start_updatetime'] != '' && $param['end_updatetime'] != '') $where[] = ['ci.updatetime', 'between', [$param['start_updatetime'] . ' 00:00:00', $param['end_updatetime'] . ' 23:59:59']];
|
|
|
+
|
|
|
+ $status = [1 => '招标进行中', 2 => '招标已结束', 3 => '等待议价结果', 4 => '确认商品', 5 => '成功转单', 6 => '取消转单', 7 => '招标已暂停'];
|
|
|
|
|
|
$data = Db::name('consult_info')
|
|
|
->alias('ci')
|
|
|
- ->field('ci.zxNo 咨询订单号,ci.good_name 产品名称,ci.num 需求数量,csi.companyName 客户名称,ci.addtime 咨询时间,ci.arrival_time 截止时间')
|
|
|
+ ->field('ci.zxNo 咨询订单号,ci.good_name 产品名称,ci.num 需求数量,csi.companyName 客户名称,ci.addtime 咨询时间,ci.arrival_time 截止时间,ci.status 状态')
|
|
|
->leftJoin('consult_bids cb', 'cb.infoNo=ci.infoNo')
|
|
|
->leftJoin('consult_order co', 'co.zxNo=ci.zxNo')
|
|
|
->leftJoin('customer_info csi', 'csi.companyNo=co.khNo')
|
|
|
->where($where)
|
|
|
->whereNull('cb.id')
|
|
|
->order('ci.arrival_time', 'desc')
|
|
|
+ ->withAttr('状态', function ($val) use ($status) {
|
|
|
+ return isset($status[$val]) ? $status[$val] : '';
|
|
|
+ })
|
|
|
->select()
|
|
|
->toArray();
|
|
|
|
|
@@ -1965,6 +1985,7 @@ class Report extends Base
|
|
|
'token',
|
|
|
'start_date' => '',
|
|
|
'end_date' => '',
|
|
|
+ 'spuCode' => '',
|
|
|
'page' => 1,
|
|
|
'size' => 15
|
|
|
], 'post', 'trim');
|
|
@@ -1978,21 +1999,24 @@ class Report extends Base
|
|
|
|
|
|
$where = [];
|
|
|
if ($param['start_date'] != '' && $param['end_date'] != '') $where[] = ['gp.addtime', 'between', [$param['start_date'] . ' 00:00:00', $param['end_date'] . ' 23:59:59']];
|
|
|
+ if ($param['spuCode'] != '') $where[] = ['gp.spuCode', 'like', '%' . $param['spuCode'] . '%'];
|
|
|
|
|
|
$count = Db::name('good_platform')
|
|
|
->alias('gp')
|
|
|
->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode')
|
|
|
->leftJoin('platform p', 'p.id=gp.platform_code')
|
|
|
->leftJoin('good_nake gn', 'gn.spuCode=gb.spuCode')
|
|
|
+ ->leftJoin('good_ladder c', 'c.skuCode=gp.skuCode AND c.is_del=0')
|
|
|
->where($where)
|
|
|
->count('gp.id');
|
|
|
|
|
|
$data = Db::name('good_platform')
|
|
|
->alias('gp')
|
|
|
- ->field('gp.skuCode,gp.spuCode,gp.plat_code,gb.good_name,p.platform_name,gp.online_time,gb.moq,gn.nake_fee,gb.cost_fee,gn.delivery_fee,gb.cert_fee,gb.mark_fee,gb.packing_fee,gn.other_fee,gn.nake_total,gp.addtime')
|
|
|
+ ->field('gp.skuCode,gp.spuCode,gp.plat_code,gb.good_name,p.platform_name,gp.online_time,c.min_num moq,gn.nake_fee,gb.cost_fee,gn.delivery_fee,gb.cert_fee,gb.mark_fee,gb.packing_fee,gn.other_fee,gn.nake_total,gp.addtime')
|
|
|
->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode')
|
|
|
->leftJoin('platform p', 'p.id=gp.platform_code')
|
|
|
->leftJoin('good_nake gn', 'gn.spuCode=gb.spuCode')
|
|
|
+ ->leftJoin('good_ladder c', 'c.skuCode=gp.skuCode AND c.is_del=0')//加入c.is_del可以命中索引
|
|
|
->where($where)
|
|
|
->order('gp.id', 'desc')
|
|
|
->page($param['page'], $param['size'])
|
|
@@ -2009,7 +2033,8 @@ class Report extends Base
|
|
|
$param = $this->request->only([
|
|
|
'token',
|
|
|
'start_date' => '',
|
|
|
- 'end_date' => ''
|
|
|
+ 'end_date' => '',
|
|
|
+ 'spuCode' => '',
|
|
|
], 'post', 'trim');
|
|
|
|
|
|
$val_params = Validate::rule([
|
|
@@ -2021,14 +2046,16 @@ class Report extends Base
|
|
|
|
|
|
$where = [];
|
|
|
if ($param['start_date'] != '' && $param['end_date'] != '') $where[] = ['gp.addtime', 'between', [$param['start_date'] . ' 00:00:00', $param['end_date'] . ' 23:59:59']];
|
|
|
+ if ($param['spuCode'] != '') $where[] = ['gp.spuCode', 'like', '%' . $param['spuCode'] . '%'];
|
|
|
|
|
|
$data = Db::name('good_platform')
|
|
|
->alias('gp')
|
|
|
- ->field('gp.skuCode as 商品上线编号,gp.spuCode as 商品成本编号,gp.plat_code as 平台商品编码,gb.good_name as 商品名称,p.platform_name as 上线平台,gp.online_time as 上线完成时间,gb.moq 起订量,gn.nake_fee 成本单价,gb.cost_fee 工艺费,gn.delivery_fee 物流费,gb.cert_fee 证书费,gb.mark_fee 加标费,gb.packing_fee 包装费,gn.other_fee 其他费用,gn.nake_total 成本合计,gp.addtime 申请上线时间')
|
|
|
+ ->field('gp.skuCode as 商品上线编号,gp.spuCode as 商品成本编号,gp.plat_code as 平台商品编码,gb.good_name as 商品名称,p.platform_name as 上线平台,gp.online_time as 上线完成时间,c.min_num 起订量,gn.nake_fee 成本单价,gb.cost_fee 工艺费,gn.delivery_fee 物流费,gb.cert_fee 证书费,gb.mark_fee 加标费,gb.packing_fee 包装费,gn.other_fee 其他费用,gn.nake_total 成本合计,gp.addtime 申请上线时间')
|
|
|
->where($where)
|
|
|
->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode')
|
|
|
->leftJoin('platform p', 'p.id=gp.platform_code')
|
|
|
->leftJoin('good_nake gn', 'gn.spuCode=gb.spuCode')
|
|
|
+ ->leftJoin('good_ladder c', 'c.skuCode=gp.skuCode AND c.is_del=0')
|
|
|
->order('gp.id', 'desc')
|
|
|
->select()
|
|
|
->toArray();
|
|
@@ -2047,6 +2074,7 @@ class Report extends Base
|
|
|
'token',
|
|
|
'start_date' => '',
|
|
|
'end_date' => '',
|
|
|
+ 'spuCode' => '',
|
|
|
'page' => 1,
|
|
|
'size' => 15
|
|
|
], 'post', 'trim');
|
|
@@ -2060,6 +2088,7 @@ class Report extends Base
|
|
|
|
|
|
$where = [];
|
|
|
if ($param['start_date'] != '' && $param['end_date'] != '') $where[] = ['gp.addtime', 'between', [$param['start_date'] . ' 00:00:00', $param['end_date'] . ' 23:59:59']];
|
|
|
+ if ($param['spuCode'] != '') $where[] = ['gp.spuCode', 'like', '%' . $param['spuCode'] . '%'];
|
|
|
|
|
|
$count = Db::name('good_platform')
|
|
|
->alias('gp')
|
|
@@ -2071,11 +2100,11 @@ class Report extends Base
|
|
|
|
|
|
$data = Db::name('good_platform')
|
|
|
->alias('gp')
|
|
|
- ->field('gp.skuCode,gp.spuCode,gp.plat_code,gb.good_name,p.platform_name,gp.online_time,gb.moq,gl.sale_price,gl.cost_fee,gl.market_price,gl.market_platform,gp.addtime')
|
|
|
+ ->field('gp.skuCode,gp.spuCode,gp.plat_code,gb.good_name,p.platform_name,gp.online_time,gl.min_num moq,gl.sale_price,gl.cost_fee,gl.market_price,gl.market_platform,gp.addtime')
|
|
|
->where($where)
|
|
|
->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode')
|
|
|
->leftJoin('platform p', 'p.id=gp.platform_code')
|
|
|
- ->leftJoin('good_ladder gl', 'gl.skuCode=gp.skuCode')
|
|
|
+ ->leftJoin('good_ladder gl', 'gl.skuCode=gp.skuCode AND gl.is_del=0')//加入is_del可以命中索引
|
|
|
->order('gp.id', 'desc')
|
|
|
->page($param['page'], $param['size'])
|
|
|
->select()
|
|
@@ -2091,7 +2120,8 @@ class Report extends Base
|
|
|
$param = $this->request->only([
|
|
|
'token',
|
|
|
'start_date' => '',
|
|
|
- 'end_date' => ''
|
|
|
+ 'end_date' => '',
|
|
|
+ 'spuCode' => ''
|
|
|
], 'post', 'trim');
|
|
|
|
|
|
$val_params = Validate::rule([
|
|
@@ -2103,14 +2133,15 @@ class Report extends Base
|
|
|
|
|
|
$where = [];
|
|
|
if ($param['start_date'] != '' && $param['end_date'] != '') $where[] = ['gp.addtime', 'between', [$param['start_date'] . ' 00:00:00', $param['end_date'] . ' 23:59:59']];
|
|
|
+ if ($param['spuCode'] != '') $where[] = ['gp.spuCode', 'like', '%' . $param['spuCode'] . '%'];
|
|
|
|
|
|
$data = Db::name('good_platform')
|
|
|
->alias('gp')
|
|
|
- ->field('gp.skuCode as 商品上线编号,gp.spuCode as 商品成本编号,gp.plat_code as 平台商品编码,gb.good_name as 商品名称,p.platform_name as 上线平台,gp.online_time as 上线完成时间,gb.moq 起订量,gl.sale_price 售价,gl.cost_fee 工艺费,gl.market_price 市场价,gl.market_platform 对比平台,gp.addtime 申请上线时间')
|
|
|
+ ->field('gp.skuCode as 商品上线编号,gp.spuCode as 商品成本编号,gp.plat_code as 平台商品编码,gb.good_name as 商品名称,p.platform_name as 上线平台,gp.online_time as 上线完成时间,gl.min_num 起订量,gl.sale_price 售价,gl.cost_fee 工艺费,gl.market_price 市场价,gl.market_platform 对比平台,gp.addtime 申请上线时间')
|
|
|
->where($where)
|
|
|
->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode')
|
|
|
->leftJoin('platform p', 'p.id=gp.platform_code')
|
|
|
- ->leftJoin('good_ladder gl', 'gl.skuCode=gp.skuCode')
|
|
|
+ ->leftJoin('good_ladder gl', 'gl.skuCode=gp.skuCode AND gl.is_del=0')
|
|
|
->order('gp.id', 'desc')
|
|
|
->select()
|
|
|
->toArray();
|