|
@@ -499,6 +499,8 @@ class Report extends Base
|
|
|
'cbaddtime_end_date' => '',
|
|
|
'supplier' => '',
|
|
|
'creater' => '',
|
|
|
+ 'good_name' => '',
|
|
|
+ 'apply_name' => '',
|
|
|
'page' => 1,
|
|
|
'size' => 15,
|
|
|
], 'post', 'trim');
|
|
@@ -519,6 +521,8 @@ class Report extends Base
|
|
|
if ($param['supplier'] != '') $where[] = ['cb.supplierNo|cb.supplierName', 'like', '%' . $param['supplier'] .'%'];
|
|
|
if ($param['creater'] != '') $where[] = ['cb.creater', 'like', '%' . $param['creater'] . '%'];
|
|
|
if ($param['zxNo'] != '') $where[] = ['cb.infoNo', 'like', '%' . $param['zxNo'] . '%'];
|
|
|
+ if ($param['good_name'] != '') $where[] = ['cb.good_name', 'like', '%' . $param['good_name'] . '%'];
|
|
|
+ if ($param['apply_name'] != '') $where[] = ['co.creater', 'like', '%' . $param['apply_name'] . '%'];
|
|
|
|
|
|
|
|
|
$count = Db::name('consult_bids')
|
|
@@ -590,6 +594,8 @@ class Report extends Base
|
|
|
'cbaddtime_end_date' => '',
|
|
|
'supplier' => '',
|
|
|
'creater' => '',
|
|
|
+ 'good_name' => '',
|
|
|
+ 'apply_name' => '',
|
|
|
'page' => 1,
|
|
|
'size' => 15,
|
|
|
], 'post', 'trim');
|
|
@@ -613,7 +619,8 @@ class Report extends Base
|
|
|
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'] . '%');
|
|
|
-
|
|
|
+ if ($param['good_name'] != '') $where[] = ['cb.good_name', 'like', '%' . $param['good_name'] . '%'];
|
|
|
+ if ($param['apply_name'] != '') $where[] = ['co.creater', 'like', '%' . $param['apply_name'] . '%'];
|
|
|
|
|
|
$data = $rs
|
|
|
->field('ci.addtime as 咨询时间,cb.bidNo as 采购单反馈单号,cb.infoNo as 咨询订单号,cb.addtime as 回复时间,cb.good_name as 产品名称,cb.supplierName as 供应商名称,cb.total_fee 成本合计,cb.delivery_day 物流时间,cb.work_day 产品工期,cb.expire_day 信息有效期,cb.creater 采购员,"" 采购员所属部门,ci.num 需求数量,ci.arrival_time 要求到货日期,co.salesman 业务人员,"" 业务人员所属部门,"" 客户名称,co.khNo,cb.createrid,co.saleid')
|
|
@@ -656,6 +663,9 @@ class Report extends Base
|
|
|
'end_date' => '',
|
|
|
'start_updatetime' => '',
|
|
|
'end_updatetime' => '',
|
|
|
+ "apply_name"=>"",
|
|
|
+ "status"=>"",
|
|
|
+ "depart"=>"",
|
|
|
'page' => 1,
|
|
|
'size' => 15,
|
|
|
], 'post', 'trim');
|
|
@@ -673,9 +683,15 @@ 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['apply_name'] != '') $where[] = ['co.creater', 'like', '%' . $param['apply_name'] . '%'];
|
|
|
+ if ($param['status'] != '') $where[] = ['ci.status', '=', $param['status']];
|
|
|
+ if ($param['depart'] != ''){
|
|
|
+ $uarr =get_company_item_user_by_name($param['dapart']);
|
|
|
+ $where[] = ['co.createrid', 'in', $uarr];
|
|
|
+ }
|
|
|
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 => '招标已暂停'];
|
|
|
+ $status = [1 => '招标进行中', 2 => '招标已结束', 3 => '等待议价结果', 4 => '确认商品', 5 => '成功转单', 6 => '超时已关闭', 7 => '招标已暂停'];
|
|
|
|
|
|
$count = Db::name('consult_info')
|
|
|
->alias('ci')
|
|
@@ -689,7 +705,7 @@ class Report extends Base
|
|
|
|
|
|
$data = Db::name('consult_info')
|
|
|
->alias('ci')
|
|
|
- ->field('ci.infoNo zxNo,ci.good_name,ci.num,csi.companyName,ci.addtime,ci.arrival_time endtime,ci.updatetime,ci.status')
|
|
|
+ ->field('ci.infoNo zxNo,ci.good_name,ci.num,csi.companyName,ci.addtime,ci.arrival_time endtime,ci.updatetime,ci.status,co.creater,co.createrid')
|
|
|
->leftJoin('consult_bids cb', 'cb.infoNo=ci.infoNo')
|
|
|
->leftJoin('consult_order co', 'co.zxNo=ci.zxNo')
|
|
|
->leftJoin('customer_info csi', 'csi.companyNo=co.khNo')
|
|
@@ -702,6 +718,10 @@ class Report extends Base
|
|
|
})
|
|
|
->select()
|
|
|
->toArray();
|
|
|
+ $deparuid =get_company_name_by_uid(array_unique(array_column($data,"createrid")));
|
|
|
+ foreach ($data as &$v) {
|
|
|
+ $v['depart']=$deparuid[$v['createrid']]??"";
|
|
|
+ }
|
|
|
|
|
|
return json_show(0, '请求成功', ['list' => $data, 'count' => $count]);
|
|
|
|
|
@@ -718,6 +738,9 @@ class Report extends Base
|
|
|
'end_date' => '',
|
|
|
'start_updatetime' => '',
|
|
|
'end_updatetime' => '',
|
|
|
+ "apply_name"=>"",
|
|
|
+ "status"=>"",
|
|
|
+ "depart"=>"",
|
|
|
], 'post', 'trim');
|
|
|
|
|
|
$val_params = Validate::rule([
|
|
@@ -734,12 +757,19 @@ 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 => '招标已暂停'];
|
|
|
+ if ($param['apply_name'] != '') $where[] = ['co.creater', 'like', '%' . $param['apply_name'] . '%'];
|
|
|
+ if ($param['status'] != '') $where[] = ['ci.status', '=', $param['status']];
|
|
|
+ if ($param['depart'] != ''){
|
|
|
+ $uarr =get_company_item_user_by_name($param['dapart']);
|
|
|
+ $where[] = ['co.createrid', 'in', $uarr];
|
|
|
+ }
|
|
|
+ $status = [1 => '招标进行中', 2 => '招标已结束', 3 => '等待议价结果', 4 => '确认商品', 5 => '成功转单', 6 => '超时已关闭', 7 => '招标已暂停'];
|
|
|
|
|
|
$data = Db::name('consult_info')
|
|
|
->alias('ci')
|
|
|
- ->field('ci.infoNo 竞价订单号,ci.good_name 商品名称,ci.num 需求数量,csi.companyName 客户名称,ci.addtime 创建时间,ci.arrival_time 截止时间,ci.updatetime 结束时间,ci.status 状态')
|
|
|
+ ->field('ci.infoNo 竞价订单号,ci.good_name 商品名称,
|
|
|
+ ci.num 需求数量,csi.companyName 客户名称,ci.addtime 创建时间,ci.arrival_time 截止时间,ci.updatetime 结束时间,
|
|
|
+ ci.status 状态,co.creater 业务人员,co.createrid 部门')
|
|
|
->leftJoin('consult_bids cb', 'cb.infoNo=ci.infoNo')
|
|
|
->leftJoin('consult_order co', 'co.zxNo=ci.zxNo')
|
|
|
->leftJoin('customer_info csi', 'csi.companyNo=co.khNo')
|
|
@@ -753,6 +783,12 @@ class Report extends Base
|
|
|
->toArray();
|
|
|
|
|
|
if (empty($data)) $data[] = ['没有可供导出的数据'];
|
|
|
+ else{
|
|
|
+ $deparuid =get_company_name_by_uid(array_unique(array_column($data,"部门")));
|
|
|
+ foreach ($data as &$v) {
|
|
|
+ $v['部门']=$deparuid[$v['部门']]??"";
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
$headerArr = array_keys($data[0]);
|
|
|
excelSave('咨询单报表-未采反信息' . date('YmdHis'), $headerArr, $data);
|