|
@@ -384,8 +384,8 @@ class Report extends Base
|
|
|
'token',
|
|
|
'start_date' => '',
|
|
|
'end_date' => '',
|
|
|
- 'page' => 1,
|
|
|
- 'size' => 15,
|
|
|
+// 'page' => 1,
|
|
|
+// 'size' => 15,
|
|
|
// 'supplier' => ''
|
|
|
], 'post', 'trim');
|
|
|
|
|
@@ -400,17 +400,17 @@ class Report extends Base
|
|
|
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'] != '') $where[] = ['s.name', 'like', '%' . $param['supplier'] . '%'];
|
|
|
|
|
|
- $count = 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')
|
|
|
- ->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')
|
|
|
- ->count();
|
|
|
+// $count = 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')
|
|
|
+// ->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')
|
|
|
+// ->count();
|
|
|
|
|
|
$list = Db::name('consult_bids')
|
|
|
->alias('cb')
|
|
@@ -462,7 +462,7 @@ class Report extends Base
|
|
|
}
|
|
|
|
|
|
$da[] = ['addtime' => '汇总', 'itemid' => 0, 'createrid' => 0, 'num' => array_sum(array_column($da, 'num')), 'total' => array_sum(array_column($da, 'total')), 'nickname' => '', 'name' => ''];
|
|
|
- return app_show(0, '请求成功', ['list' => $da, 'count' => $count]);
|
|
|
+ return app_show(0, '请求成功', $da);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -2266,7 +2266,9 @@ class Report extends Base
|
|
|
//【今日咨询单】列表
|
|
|
public function todayZx()
|
|
|
{
|
|
|
+ $a = $this->todayZxTotal();
|
|
|
|
|
|
+ halt($a);
|
|
|
$param = $this->request->only([
|
|
|
'token',
|
|
|
'start_date' => '',
|
|
@@ -2319,10 +2321,25 @@ class Report extends Base
|
|
|
//【今日咨询单】今日咨询单总量,为上面列表和导出接口服务
|
|
|
private function todayZxTotal()
|
|
|
{
|
|
|
- $data = Db::name('consult_bids')
|
|
|
+ //今日咨询单总量
|
|
|
+ $today_consult_total = Db::name('consult_bids')
|
|
|
->where(['is_del' => 0])
|
|
|
->whereTime('addtime', 'today')
|
|
|
->count('id');
|
|
|
+
|
|
|
+ //今日采购单总量
|
|
|
+ $today_purchease_order_total = Db::name('purchease_order')
|
|
|
+ ->where(['is_del' => 0])
|
|
|
+ ->whereTime('addtime', 'today')
|
|
|
+ ->count('id');
|
|
|
+
|
|
|
+ //to B 订单数量
|
|
|
+ $today_purchease_order_total = Db::name('sale')
|
|
|
+ ->where(['is_del' => 0])
|
|
|
+ ->whereTime('addtime', 'today')
|
|
|
+ ->count('id');
|
|
|
+
|
|
|
+ return $data;
|
|
|
}
|
|
|
|
|
|
|