作者 李宇航

合并分支 'master-server' 到 'master'

Master server



查看合并请求 !1258
@@ -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);
@@ -7,6 +7,7 @@ use App\Http\Controllers\Aside\BaseController; @@ -7,6 +7,7 @@ use App\Http\Controllers\Aside\BaseController;
7 use App\Http\Logic\Aside\Ai\AiCommandLogic; 7 use App\Http\Logic\Aside\Ai\AiCommandLogic;
8 use App\Http\Requests\Aside\Ai\AiCommandRequest; 8 use App\Http\Requests\Aside\Ai\AiCommandRequest;
9 use App\Models\Ai\AiCommand as AiCommandModel; 9 use App\Models\Ai\AiCommand as AiCommandModel;
  10 +use App\Models\Project\Project;
10 11
11 /** 12 /**
12 * @remark :ai指令 13 * @remark :ai指令
@@ -28,8 +29,17 @@ class AiCommandController extends BaseController @@ -28,8 +29,17 @@ class AiCommandController extends BaseController
28 $this->map['name|key|ai'] = ['like','%'.$this->map['scene'].'%']; 29 $this->map['name|key|ai'] = ['like','%'.$this->map['scene'].'%'];
29 unset($this->map['scene']); 30 unset($this->map['scene']);
30 } 31 }
31 -  
32 $lists = $aiCommandModel->lists($this->map,$this->page,$this->row,$this->order); 32 $lists = $aiCommandModel->lists($this->map,$this->page,$this->row,$this->order);
  33 + $projectModel = new Project();
  34 + if(!empty($lists) && !empty($lists['list'])){
  35 + foreach ($lists['list'] as $k => $v){
  36 + $v['project_name'] = '';
  37 + if($v['project_id'] != 0){
  38 + $v['project_name'] = $projectModel->getProjectName($v['project_id']);
  39 + }
  40 + $lists['list'][$k] = $v;
  41 + }
  42 + }
33 $this->response('success',Code::SUCCESS,$lists); 43 $this->response('success',Code::SUCCESS,$lists);
34 } 44 }
35 45