|
|
@@ -34,17 +34,24 @@ class LargeWasteRewardPunish extends Api
|
|
|
$this->error('请求方式错误');
|
|
|
}
|
|
|
$rows = db()->table('db_大废品')
|
|
|
- ->field('LEFT(sys_rq, 10) as date, COUNT(*) as counts')
|
|
|
+ ->field('DISTINCT(LEFT(sys_rq, 7)) AS mouth,LEFT(sys_rq, 10) as date, COUNT(*) as counts')
|
|
|
->group('date')
|
|
|
->order('UniqId desc')
|
|
|
->limit(40)
|
|
|
->select();
|
|
|
|
|
|
-
|
|
|
+ $list = [];
|
|
|
foreach($rows as $key=>$value){
|
|
|
- $rows[$key]['date'] = str_replace('-', '.', $rows[$key]['date']);
|
|
|
+ if (!isset($list[$value['mouth']])){
|
|
|
+ $list[$value['mouth']] = [];
|
|
|
+ }
|
|
|
+ $arr['date'] = str_replace('-', '.', $rows[$key]['date']);
|
|
|
+ $arr['counts'] = $rows[$key]['counts'];
|
|
|
+ array_push($list[$value['mouth']],$arr);
|
|
|
+// $list[$value['mouth']]['date'] = str_replace('-', '.', $rows[$key]['date']);
|
|
|
+
|
|
|
}
|
|
|
- $this->success('成功',$rows);
|
|
|
+ $this->success('成功',$list);
|
|
|
}
|
|
|
|
|
|
/**
|