|
@@ -504,13 +504,19 @@ class Report extends Base
|
|
|
'zxNo' => [],
|
|
|
'start_date' => '',
|
|
|
'end_date' => '',
|
|
|
+ 'cbaddtime_start_date' => '',
|
|
|
+ 'cbaddtime_end_date' => '',
|
|
|
+ 'supplier' => '',
|
|
|
+ 'creater' => '',
|
|
|
'page' => 1,
|
|
|
'size' => 15,
|
|
|
], 'post', 'trim');
|
|
|
|
|
|
$val_params = Validate::rule([
|
|
|
- 'start_date' => 'date|elt:end_date',
|
|
|
- 'end_date' => 'date',
|
|
|
+ 'start_date|竞价开始时间' => 'date|elt:end_date',
|
|
|
+ 'end_date|竞价开始时间' => 'date|egt:start_date',
|
|
|
+ 'cbaddtime_start_date|采购回复开始时间' => 'date|elt:cbaddtime_end_date',
|
|
|
+ 'cbaddtime_end_date|采购回复开始时间' => 'date|egt:cbaddtime_start_date',
|
|
|
]);
|
|
|
|
|
|
if (!$val_params->check($param)) return error_show(1004, $val_params->getError());
|
|
@@ -518,7 +524,10 @@ class Report extends Base
|
|
|
$where = [['cb.is_del', '=', 0]];
|
|
|
|
|
|
if ($param['start_date'] != '' && $param['end_date'] != '') $where[] = ['ci.addtime', 'between', [$param['start_date'] . ' 00:00:00', $param['end_date'] . ' 23:59:59']];
|
|
|
- if (!empty($param['zxNo'])) $where[] = ['cb.infoNo', 'in', $param['zxNo']];
|
|
|
+ if ($param['cbaddtime_start_date'] != '' && $param['cbaddtime_end_date'] != '') $where[] = ['cb.addtime', 'between', [$param['cbaddtime_start_date'] . ' 00:00:00', $param['cbaddtime_end_date'] . ' 23:59:59']];
|
|
|
+ if ($param['supplier'] != '') $where[] = ['cb.supplierNo|s.name', 'like', '%' . $param['supplier'] . '%'];
|
|
|
+ if ($param['creater'] != '') $where[] = ['cb.creater', 'like', '%' . $param['creater'] . '%'];
|
|
|
+ if ($param['zxNo'] != '') $where[] = ['cb.infoNo', 'in', $param['zxNo']];
|
|
|
|
|
|
|
|
|
$count = Db::name('consult_bids')
|
|
@@ -569,7 +578,7 @@ class Report extends Base
|
|
|
'companyName' => '',
|
|
|
];
|
|
|
|
|
|
- return app_show(0, '请求成功', ['list' => $data, 'count' => $count]);
|
|
|
+ return app_show(0, '请求成功', ['count' => $count, 'list' => $data]);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -581,13 +590,19 @@ class Report extends Base
|
|
|
'zxNo' => [],
|
|
|
'start_date' => '',
|
|
|
'end_date' => '',
|
|
|
+ 'cbaddtime_start_date' => '',
|
|
|
+ 'cbaddtime_end_date' => '',
|
|
|
+ 'supplier' => '',
|
|
|
+ 'creater' => '',
|
|
|
'page' => 1,
|
|
|
'size' => 15,
|
|
|
], 'post', 'trim');
|
|
|
|
|
|
$val_params = Validate::rule([
|
|
|
- 'start_date' => 'date|elt:end_date',
|
|
|
- 'end_date' => 'date',
|
|
|
+ 'start_date|竞价开始时间' => 'date|elt:end_date',
|
|
|
+ 'end_date|竞价开始时间' => 'date|egt:start_date',
|
|
|
+ 'cbaddtime_start_date|采购回复开始时间' => 'date|elt:cbaddtime_end_date',
|
|
|
+ 'cbaddtime_end_date|采购回复开始时间' => 'date|egt:cbaddtime_start_date',
|
|
|
]);
|
|
|
|
|
|
if (!$val_params->check($param)) return error_show(1004, $val_params->getError());
|
|
@@ -597,7 +612,11 @@ class Report extends Base
|
|
|
->where('cb.is_del', 0);
|
|
|
|
|
|
if ($param['start_date'] != '' && $param['end_date'] != '') $rs->whereBetween('ci.addtime', [$param['start_date'] . ' 00:00:00', $param['end_date'] . ' 23:59:59']);
|
|
|
- if (!empty($param['zxNo'])) $rs->whereIn('cb.infoNo', $param['zxNo']);
|
|
|
+ if ($param['zxNo'] != '') $rs->whereIn('cb.infoNo', $param['zxNo']);
|
|
|
+
|
|
|
+ if ($param['cbaddtime_start_date'] != '' && $param['cbaddtime_end_date'] != '') $rs->whereBetween('cb.addtime', [$param['cbaddtime_start_date'] . ' 00:00:00', $param['cbaddtime_end_date'] . ' 23:59:59']);
|
|
|
+ if ($param['supplier'] != '') $rs->whereLike('cb.supplierNo|s.name', '%' . $param['supplier'] . '%');
|
|
|
+ if ($param['creater'] != '') $rs->whereLike('cb.creater', '%' . $param['creater'] . '%');
|
|
|
|
|
|
|
|
|
$data = $rs
|
|
@@ -1230,7 +1249,7 @@ class Report extends Base
|
|
|
$count = Db::name('good_platform')
|
|
|
->alias('gp')
|
|
|
->where($where)
|
|
|
- ->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode')
|
|
|
+ ->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode AND gb.is_del=0')
|
|
|
->leftJoin('brand b', 'b.id=gb.brand_id')
|
|
|
->leftJoin('supplier s', 's.code=gb.supplierNo')
|
|
|
->count('gp.id');
|
|
@@ -1239,7 +1258,7 @@ class Report extends Base
|
|
|
->alias('gp')
|
|
|
->field('gb.createrid,gb.creater,"" company_name,gp.skuCode,gp.spuCode,gb.good_name,b.brand_name,"" good_model,s.name,gb.tax,gb.nake_price,gp.online_time')
|
|
|
->where($where)
|
|
|
- ->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode')
|
|
|
+ ->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode AND gb.is_del=0')
|
|
|
->leftJoin('brand b', 'b.id=gb.brand_id')
|
|
|
->leftJoin('supplier s', 's.code=gb.supplierNo')
|
|
|
->page($param['page'], $param['size'])
|
|
@@ -1293,7 +1312,7 @@ class Report extends Base
|
|
|
->alias('gp')
|
|
|
->field('gb.creater 采购维护人,"" 采购维护人所属部门,gp.skuCode 商品上线编号,gp.spuCode 商品成本编号,gb.good_name 商品名称,b.brand_name 品牌名称,"" 商品型号,s.name 供应商名称,gb.tax 税点,gb.nake_price 成本价合计,gp.online_time 上线时间,gb.createrid')
|
|
|
->where($where)
|
|
|
- ->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode')
|
|
|
+ ->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode AND gb.is_del=0')
|
|
|
->leftJoin('brand b', 'b.id=gb.brand_id')
|
|
|
->leftJoin('supplier s', 's.code=gb.supplierNo')
|
|
|
->cursor();
|
|
@@ -1351,7 +1370,7 @@ class Report extends Base
|
|
|
$count = Db::name('good_platform')
|
|
|
->alias('gp')
|
|
|
->where($where)
|
|
|
- ->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode')
|
|
|
+ ->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode AND gb.is_del=0')
|
|
|
->leftJoin('supplier s', 's.code=gb.supplierNo')
|
|
|
->count('gp.id');
|
|
|
|
|
@@ -1359,7 +1378,7 @@ class Report extends Base
|
|
|
->alias('gp')
|
|
|
->field('gp.updatetime,gb.createrid,gb.creater,"" company_name,gb.creater,gp.skuCode,gp.spuCode,gb.good_name,s.name')
|
|
|
->where($where)
|
|
|
- ->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode')
|
|
|
+ ->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode AND gb.is_del=0')
|
|
|
->leftJoin('supplier s', 's.code=gb.supplierNo')
|
|
|
->withAttr('company_name', function ($val, $data) {
|
|
|
return get_company_name_by_uid($data['createrid']);
|
|
@@ -1399,7 +1418,7 @@ class Report extends Base
|
|
|
->alias('gp')
|
|
|
->field('gp.updatetime 商品下线时间,gb.creater 采购维护人,"" 采购维护人所属部门,gp.skuCode 商品上线编号,gp.spuCode 商品成本编号,gb.good_name 商品名称,s.name 供应商名称,gb.createrid')
|
|
|
->where($where)
|
|
|
- ->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode')
|
|
|
+ ->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode AND gb.is_del=0')
|
|
|
->leftJoin('supplier s', 's.code=gb.supplierNo')
|
|
|
->cursor();
|
|
|
|
|
@@ -1444,7 +1463,7 @@ class Report extends Base
|
|
|
|
|
|
$count = Db::name('change_log')
|
|
|
->alias('cl')
|
|
|
- ->leftJoin('good_basic gb', 'gb.spuCode=cl.code')
|
|
|
+ ->leftJoin('good_basic gb', 'gb.spuCode=cl.code AND gb.is_del=0')
|
|
|
->leftJoin('supplier s', 's.code=gb.supplierNo')
|
|
|
->where($where)
|
|
|
->count('cl.id');
|
|
@@ -1452,7 +1471,7 @@ class Report extends Base
|
|
|
$data = Db::name('change_log')
|
|
|
->alias('cl')
|
|
|
->field('cl.addtime,gb.createrid,gb.creater,"" company_name,cl.code,gb.good_name,s.name,cl.before_info,cl.after_info')
|
|
|
- ->leftJoin('good_basic gb', 'gb.spuCode=cl.code')
|
|
|
+ ->leftJoin('good_basic gb', 'gb.spuCode=cl.code AND gb.is_del=0')
|
|
|
->leftJoin('supplier s', 's.code=gb.supplierNo')
|
|
|
->where($where)
|
|
|
->order('cl.addtime', 'desc')
|
|
@@ -1619,7 +1638,7 @@ class Report extends Base
|
|
|
$data = Db::name('change_log')
|
|
|
->alias('cl')
|
|
|
->field('cl.addtime 商品操作时间,gb.creater 采购维护人,"" 采购维护人所在部门,cl.code 商品成本编号,gb.good_name 商品名称,s.name 供应商名称,cl.before_info 修改前的内容,cl.after_info 修改后的内容,gb.createrid')
|
|
|
- ->leftJoin('good_basic gb', 'gb.spuCode=cl.code')
|
|
|
+ ->leftJoin('good_basic gb', 'gb.spuCode=cl.code AND gb.is_del=0')
|
|
|
->leftJoin('supplier s', 's.code=gb.supplierNo')
|
|
|
->where($where)
|
|
|
->cursor();
|
|
@@ -1828,7 +1847,7 @@ class Report extends Base
|
|
|
* ->field('"" 创建人,"" 创建人公司,"" 创建人部门,"" 创建时间,"" 单据状态,"" 采购单号,gl.type 出入库类型,gb.good_name 商品名称,gb.spuCode 产品编码,gl.stock 出入库数量,gl.addtime 出入库日期,"" 维护人员,"" 发起人,wi.wsm_type 库房性质,s.name 库房公司,wi.name 库房名称')
|
|
|
* // ->where($where)
|
|
|
* ->leftJoin('good_stock gs', 'gs.id=gl.stock_id')
|
|
|
- * ->leftJoin('good_basic gb', 'gb.spuCode=gs.spuCode')
|
|
|
+ * ->leftJoin('good_basic gb', 'gb.spuCode=gs.spuCode AND gb.is_del=0')
|
|
|
* ->leftJoin('warehouse_info wi', 'wi.wsm_code=gs.wsm_code')
|
|
|
* ->leftJoin('supplier s', 's.code=wi.supplierNo')
|
|
|
* // ->leftJoin('supplier s', 's.code=gb.supplierNo')
|
|
@@ -1870,7 +1889,7 @@ class Report extends Base
|
|
|
|
|
|
$count = Db::name('good_platform')
|
|
|
->alias('gp')
|
|
|
- ->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode')
|
|
|
+ ->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode AND gb.is_del=0')
|
|
|
->leftJoin('brand b', 'b.id=gb.brand_id')
|
|
|
->leftJoin('unit u', 'u.id=gb.good_unit')
|
|
|
->leftJoin('supplier s', 's.code=gb.supplierNo')
|
|
@@ -1881,7 +1900,7 @@ class Report extends Base
|
|
|
$list = Db::name('good_platform')
|
|
|
->alias('gp')
|
|
|
->field('gp.skuCode,gp.spuCode,gp.plat_code,gb.good_name,b.brand_name,gb.cat_id,bi.company,gb.creater,p.platform_name,gp.online_time,gp.exam_status,gb.is_stock,gb.good_type,u.unit,gb.good_remark,gb.craft_desc,gb.noble_metal,gb.cgd_gold_price,gb.demo_fee,gb.open_fee,gb.sample_fee,gb.tax,gb.supply_area,s.name,gp.addtime')
|
|
|
- ->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode')
|
|
|
+ ->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode AND gb.is_del=0')
|
|
|
->leftJoin('brand b', 'b.id=gb.brand_id')
|
|
|
->leftJoin('unit u', 'u.id=gb.good_unit')
|
|
|
->leftJoin('supplier s', 's.code=gb.supplierNo')
|
|
@@ -1959,7 +1978,7 @@ class Report extends Base
|
|
|
$list = Db::name('good_platform')
|
|
|
->alias('gp')
|
|
|
->field('gp.skuCode as 商品上线编号,gp.spuCode as 商品成本编号,gp.plat_code as 平台商品编码,gb.good_name as 商品名称,b.brand_name as 品牌名称,gb.cat_id as 分类,bi.company as 业务企业名称,gb.creater as 采购员,p.platform_name as 上线平台,gp.online_time as 上线完成时间,gp.exam_status as 上下线状态,gb.is_stock as 是否库存品,gb.good_type as 是否定制,"" as 规格,"" as 型号,u.unit as 单位,gb.good_remark as 商品备注,gb.craft_desc as 工艺说明,gb.noble_metal as 贵金属信息,gb.cgd_gold_price as 供应商采购金价,gb.demo_fee as 打样费,gb.open_fee as 开模费,gb.sample_fee as 调样费,gb.tax as 税点,gb.supply_area as 供货区域,s.name as 供应商名称,gp.addtime 申请上线时间')
|
|
|
- ->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode')
|
|
|
+ ->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode AND gb.is_del=0')
|
|
|
->leftJoin('brand b', 'b.id=gb.brand_id')
|
|
|
->leftJoin('unit u', 'u.id=gb.good_unit')
|
|
|
->leftJoin('supplier s', 's.code=gb.supplierNo')
|
|
@@ -2038,7 +2057,7 @@ class Report extends Base
|
|
|
|
|
|
$count = Db::name('good_platform')
|
|
|
->alias('gp')
|
|
|
- ->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode')
|
|
|
+ ->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode AND gb.is_del=0')
|
|
|
->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')
|
|
@@ -2048,7 +2067,7 @@ 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,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('good_basic gb', 'gb.spuCode=gp.spuCode AND gb.is_del=0')
|
|
|
->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可以命中索引
|
|
@@ -2087,7 +2106,7 @@ class Report extends Base
|
|
|
->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 上线完成时间,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('good_basic gb', 'gb.spuCode=gp.spuCode AND gb.is_del=0')
|
|
|
->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')
|
|
@@ -2128,7 +2147,7 @@ class Report extends Base
|
|
|
$count = Db::name('good_platform')
|
|
|
->alias('gp')
|
|
|
->where($where)
|
|
|
- ->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode')
|
|
|
+ ->leftJoin('good_basic gb', 'gb.spuCode=gp.spuCode AND gb.is_del=0')
|
|
|
->leftJoin('platform p', 'p.id=gp.platform_code')
|
|
|
->leftJoin('good_ladder gl', 'gl.skuCode=gp.skuCode')
|
|
|
->count('gp.id');
|
|
@@ -2137,7 +2156,7 @@ class Report extends Base
|
|
|
->alias('gp')
|
|
|
->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('good_basic gb', 'gb.spuCode=gp.spuCode AND gb.is_del=0')
|
|
|
->leftJoin('platform p', 'p.id=gp.platform_code')
|
|
|
->leftJoin('good_ladder gl', 'gl.skuCode=gp.skuCode AND gl.is_del=0')//加入is_del可以命中索引
|
|
|
->order('gp.id', 'desc')
|
|
@@ -2174,7 +2193,7 @@ class Report extends Base
|
|
|
->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 上线完成时间,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('good_basic gb', 'gb.spuCode=gp.spuCode AND gb.is_del=0')
|
|
|
->leftJoin('platform p', 'p.id=gp.platform_code')
|
|
|
->leftJoin('good_ladder gl', 'gl.skuCode=gp.skuCode AND gl.is_del=0')
|
|
|
->order('gp.id', 'desc')
|