|
@@ -373,7 +373,7 @@ class Report extends Base
|
|
|
'end_date' => '',
|
|
|
'page' => 1,
|
|
|
'size' => 15,
|
|
|
- 'supplier' => ''
|
|
|
+// 'supplier' => ''
|
|
|
], 'post', 'trim');
|
|
|
|
|
|
$val_params = Validate::rule([
|
|
@@ -385,13 +385,7 @@ class Report extends Base
|
|
|
|
|
|
$where = [['cb.is_del', '=', 0]];
|
|
|
if ($param['start_date'] != '' && $param['end_date'] != '') $where[] = ['cb.addtime', 'between', [$param['start_date'] . ' 00:00:00', $param['end_date'] . ' 23:59:59']];
|
|
|
- if ($param['supplier'] != '') {
|
|
|
- $codes = Db::name('supplier')
|
|
|
- ->where('is_del', 0)
|
|
|
- ->whereLike('name', '%' . $param['supplier'] . '%')
|
|
|
- ->column('code');
|
|
|
- $where[] = ['cb.supplierNo', 'in', $codes];
|
|
|
- }
|
|
|
+// if ($param['supplier'] != '') $where[] = ['s.name', 'like', '%' . $param['supplier'] . '%'];
|
|
|
|
|
|
$count = Db::name('consult_bids')
|
|
|
->alias('cb')
|
|
@@ -399,6 +393,7 @@ class Report extends Base
|
|
|
->leftJoin('consult_info c', 'c.infoNo=cb.infoNo')
|
|
|
->leftJoin('depart_user du', 'du.uid=cb.createrid AND du.is_del=0')
|
|
|
->leftJoin('company_item ci', 'ci.id=du.itemid')
|
|
|
+ ->leftJoin('supplier s', 's.code=cb.supplierNo')
|
|
|
->where($where)
|
|
|
->group('addtime,du.itemid,ci.name ,cb.createrid,du.nickname')
|
|
|
->order('addtime,du.itemid,ci.name ,cb.createrid,du.nickname')
|
|
@@ -406,12 +401,13 @@ class Report extends Base
|
|
|
|
|
|
$list = Db::name('consult_bids')
|
|
|
->alias('cb')
|
|
|
- ->field('DATE_FORMAT(cb.addtime,"%Y-%m-%d") addtime,du.itemid,cb.createrid,SUM(c.num) num,COUNT(cb.id) total,du.nickname,ci.name')
|
|
|
+ ->field('DATE_FORMAT(cb.addtime,"%Y-%m-%d") addtime,du.itemid,cb.createrid,SUM(c.num) num,COUNT(cb.id) total,du.nickname,ci.name,s.name supplierName')
|
|
|
->leftJoin('consult_info c', 'c.infoNo=cb.infoNo')
|
|
|
->leftJoin('depart_user du', 'du.uid=cb.createrid AND du.is_del=0')
|
|
|
->leftJoin('company_item ci', 'ci.id=du.itemid')
|
|
|
+ ->leftJoin('supplier s', 's.code=cb.supplierNo')
|
|
|
->where($where)
|
|
|
- ->group('addtime,du.itemid,ci.name ,cb.createrid,du.nickname')
|
|
|
+ ->group('addtime,du.itemid,ci.name ,cb.createrid,du.nickname,s.name')
|
|
|
->order('addtime desc,du.itemid,ci.name ,cb.createrid,du.nickname')
|
|
|
->page($param['page'], $param['size'])
|
|
|
->select()
|