|
@@ -103,22 +103,27 @@ class DailyStatistics extends Auth {
|
|
|
$map1[] = ['create_time', '>=', $start1];
|
|
|
$map1[] = ['create_time', '<=', $end1];
|
|
|
$map[] = ['org_id', '=', $this->orgId];
|
|
|
- $list = Db::name('daily_record')
|
|
|
- ->where($map)
|
|
|
- ->group('daily_id')
|
|
|
- ->select();
|
|
|
- foreach ($list as $k => $v) {
|
|
|
- $list[$k]['title'] = Db::name('daily')
|
|
|
- ->where('id', $v['daily_id'])
|
|
|
- ->value('title');
|
|
|
+// $list = Db::name('daily_record')
|
|
|
+// ->where($map)
|
|
|
+// ->group('daily_id')
|
|
|
+// ->select();
|
|
|
+
|
|
|
+ $addrList = model('Address')->getListByType(10,$this->orgId);
|
|
|
+ foreach ($addrList as $k => $v) {
|
|
|
+ $dailyIds = Db::name('daily')
|
|
|
+ ->where('enable',1)
|
|
|
+ ->where('del',0)
|
|
|
+ ->where('address_id',$v['id'])
|
|
|
+ ->column('id');
|
|
|
+
|
|
|
$count = Db::name('daily_record')
|
|
|
->where($map)
|
|
|
- ->where('daily_id', $v['daily_id'])
|
|
|
+ ->where('daily_id','in', $dailyIds)
|
|
|
->where($map1)
|
|
|
->count();
|
|
|
- $list[$k]['count'] = $count ? $count : 0;
|
|
|
+ $addrList[$k]['count'] = $count ? $count : 0;
|
|
|
}
|
|
|
- $this->assign('list', $list);
|
|
|
+ $this->assign('list', $addrList);
|
|
|
$this->assign('start', $start);
|
|
|
$this->assign('end', $end);
|
|
|
return $this->fetch();
|