作者 Your Name
... ... @@ -59,6 +59,6 @@ class TemplateLog extends Command
* @time :2024/7/10 14:48
*/
public function deleteTemplate(){
$templateLogModel = new TemplateLog();
}
}
... ...
... ... @@ -37,7 +37,11 @@ class SyncSubmitTask extends Command
$this->output('任务' . $task_id . '开始');
$time = time();
DB::enableQueryLog(); //启用查询日志
//清除之前的查询日志
DB::flushQueryLog();
$task_info = SyncSubmitTaskModel::find($task_id);
if (empty($task_info) || $task_info->status !=3) {
... ... @@ -77,6 +81,8 @@ class SyncSubmitTask extends Command
//数据库查询
$this->output('任务用时:' .$use_time . ' | ' . json_encode(DB::getQueryLog(),JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
}
//清除之前的查询日志
DB::flushQueryLog();
}
}
... ...
... ... @@ -54,6 +54,15 @@ class HrController extends BaseController
* @time :2023/9/6 10:05
*/
public function save(HrLogic $logic){
$this->request->validate([
'name'=>'required',
'mobile'=>'required',
'status'=>'required'
],[
'name.required' => '名称不能为空',
'mobile.required' => '手机号码不能为空',
'status.required' => '请选择用户状态',
]);
$logic->hrSave();
$this->response('success');
}
... ...
... ... @@ -417,9 +417,11 @@ class ProjectController extends BaseController
public function save(ProjectLogic $logic)
{
$this->request->validate([
'type'=>'required'
'type'=>'required',
'serve_id'=>'required',
],[
'type.required' => '类型不能为空'
'type.required' => '类型不能为空',
'serve_id.required' => '请选择服务器'
]);
$logic->projectSave();
$this->response('success');
... ...
... ... @@ -75,10 +75,8 @@ class HrLogic extends BaseLogic
$managerModel = new Manage();
$this->param['manage_id'] = $managerModel->addReturnId($data);
$this->model->add($this->param);
//同步到B端演示项目
$this->syncBProjectUser($this->param['mobile'], $this->param['mobile'], $this->param['name'], $this->param['status']);
DB::commit();
}catch (\Exception $e){
DB::rollBack();
... ...
... ... @@ -148,7 +148,7 @@ class ProjectLogic extends BaseLogic
//初始化项目
$this->createProjectData($this->param);
//双向绑定服务器,需放到保存项目的上方
$this->setServers($this->param['serve_id'] ?? 0,$this->param['id']);
$this->setServers($this->param['serve_id'],$this->param['id']);
//保存项目信息
$this->saveProject($this->param);
//保存建站部署信息
... ...
... ... @@ -16,18 +16,15 @@ class TaskOwnerLogic extends BaseLogic
public function __construct()
{
parent::__construct();
$this->model = new TaskOwner();
}
public function save($param){
//获取已分配了的
$manage_ids = $this->model->where('task_id', $param['task_id'])->pluck('manage_id', 'id')->toArray();
//待删除的
$del_manage_ids = array_diff($manage_ids, $param['manage_ids']);
$this->delete(array_keys($del_manage_ids));
//新增的
$add_manage_ids = array_diff($param['manage_ids'], $manage_ids);
foreach ($add_manage_ids as $add_manage_id){
... ...