作者 李宇航

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

Master server



查看合并请求 !1258
... ... @@ -52,7 +52,7 @@ class WeekProject extends Command
*/
public function handle(){
$projectModel = new Project();
$list = $projectModel->list(['delete_status'=>0,'is_weekly_report'=>1,'type'=>['in',[1,2,3,4,6]]],'id',['id','title']);
$list = $projectModel->list(['delete_status'=>0,'type'=>['in',[1,2,3,4,6]]],'id',['id','title']);
foreach ($list as $k => $v){
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
ProjectServer::useProject($v['id']);
... ... @@ -83,8 +83,9 @@ class WeekProject extends Command
$data['start_date'] = $startOfLastWeekFormatted = date('Y-m-d', $startOfLastWeek);
$data['end_date'] = $endOfLastWeekFormatted = date('Y-m-d', $endOfLastWeek);
$countModel = new Count();
$startOfThisWeek = date('Y-m-d', strtotime("monday this week"));
$startOfLastWeekFormattedInfo = $countModel->read(['date'=>$startOfLastWeekFormatted,'project_id'=>$value['id']],['inquiry_num','country']);
$endOfLastWeekFormattedInfo = $countModel->read(['date'=>$endOfLastWeekFormatted,'project_id'=>$value['id']],['inquiry_num','country']);
$endOfLastWeekFormattedInfo = $countModel->read(['date'=>$startOfThisWeek,'project_id'=>$value['id']],['inquiry_num','country']);
$data['inquiry_total'] = $endOfLastWeekFormattedInfo['inquiry_num'] ?? 0;//询盘数量
$data['inquiry_country'] = $endOfLastWeekFormattedInfo['country'] ?? json_encode([]);
$data['week_inquiry_total'] = ($endOfLastWeekFormattedInfo['inquiry_num'] ?? 0) - ($startOfLastWeekFormattedInfo['inquiry_num'] ?? 0);
... ...
... ... @@ -7,6 +7,7 @@ use App\Http\Controllers\Aside\BaseController;
use App\Http\Logic\Aside\Ai\AiCommandLogic;
use App\Http\Requests\Aside\Ai\AiCommandRequest;
use App\Models\Ai\AiCommand as AiCommandModel;
use App\Models\Project\Project;
/**
* @remark :ai指令
... ... @@ -28,8 +29,17 @@ class AiCommandController extends BaseController
$this->map['name|key|ai'] = ['like','%'.$this->map['scene'].'%'];
unset($this->map['scene']);
}
$lists = $aiCommandModel->lists($this->map,$this->page,$this->row,$this->order);
$projectModel = new Project();
if(!empty($lists) && !empty($lists['list'])){
foreach ($lists['list'] as $k => $v){
$v['project_name'] = '';
if($v['project_id'] != 0){
$v['project_name'] = $projectModel->getProjectName($v['project_id']);
}
$lists['list'][$k] = $v;
}
}
$this->response('success',Code::SUCCESS,$lists);
}
... ...