正在显示
1 个修改的文件
包含
3 行增加
和
2 行删除
| @@ -52,7 +52,7 @@ class WeekProject extends Command | @@ -52,7 +52,7 @@ class WeekProject extends Command | ||
| 52 | */ | 52 | */ |
| 53 | public function handle(){ | 53 | public function handle(){ |
| 54 | $projectModel = new Project(); | 54 | $projectModel = new Project(); |
| 55 | - $list = $projectModel->list(['delete_status'=>0,'is_weekly_report'=>1,'type'=>['in',[1,2,3,4,6]]],'id',['id','title']); | 55 | + $list = $projectModel->list(['delete_status'=>0,'type'=>['in',[1,2,3,4,6]]],'id',['id','title']); |
| 56 | foreach ($list as $k => $v){ | 56 | foreach ($list as $k => $v){ |
| 57 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; | 57 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; |
| 58 | ProjectServer::useProject($v['id']); | 58 | ProjectServer::useProject($v['id']); |
| @@ -83,8 +83,9 @@ class WeekProject extends Command | @@ -83,8 +83,9 @@ class WeekProject extends Command | ||
| 83 | $data['start_date'] = $startOfLastWeekFormatted = date('Y-m-d', $startOfLastWeek); | 83 | $data['start_date'] = $startOfLastWeekFormatted = date('Y-m-d', $startOfLastWeek); |
| 84 | $data['end_date'] = $endOfLastWeekFormatted = date('Y-m-d', $endOfLastWeek); | 84 | $data['end_date'] = $endOfLastWeekFormatted = date('Y-m-d', $endOfLastWeek); |
| 85 | $countModel = new Count(); | 85 | $countModel = new Count(); |
| 86 | + $startOfThisWeek = date('Y-m-d', strtotime("monday this week")); | ||
| 86 | $startOfLastWeekFormattedInfo = $countModel->read(['date'=>$startOfLastWeekFormatted,'project_id'=>$value['id']],['inquiry_num','country']); | 87 | $startOfLastWeekFormattedInfo = $countModel->read(['date'=>$startOfLastWeekFormatted,'project_id'=>$value['id']],['inquiry_num','country']); |
| 87 | - $endOfLastWeekFormattedInfo = $countModel->read(['date'=>$endOfLastWeekFormatted,'project_id'=>$value['id']],['inquiry_num','country']); | 88 | + $endOfLastWeekFormattedInfo = $countModel->read(['date'=>$startOfThisWeek,'project_id'=>$value['id']],['inquiry_num','country']); |
| 88 | $data['inquiry_total'] = $endOfLastWeekFormattedInfo['inquiry_num'] ?? 0;//询盘数量 | 89 | $data['inquiry_total'] = $endOfLastWeekFormattedInfo['inquiry_num'] ?? 0;//询盘数量 |
| 89 | $data['inquiry_country'] = $endOfLastWeekFormattedInfo['country'] ?? json_encode([]); | 90 | $data['inquiry_country'] = $endOfLastWeekFormattedInfo['country'] ?? json_encode([]); |
| 90 | $data['week_inquiry_total'] = ($endOfLastWeekFormattedInfo['inquiry_num'] ?? 0) - ($startOfLastWeekFormattedInfo['inquiry_num'] ?? 0); | 91 | $data['week_inquiry_total'] = ($endOfLastWeekFormattedInfo['inquiry_num'] ?? 0) - ($startOfLastWeekFormattedInfo['inquiry_num'] ?? 0); |
-
请 注册 或 登录 后发表评论