作者 lyh

gx

... ... @@ -3,6 +3,7 @@
namespace App\Http\Controllers\Aside\Project;
use App\Enums\Common\Code;
use App\Helper\Common;
use App\Http\Controllers\Aside\BaseController;
use App\Http\Logic\Aside\Project\OnlineCheckLogic;
use App\Http\Logic\Aside\Project\ProcessRecordsLogic;
... ... @@ -72,6 +73,13 @@ class ProjectController extends BaseController
return $this->success($data);
}
/**
* @remark :获取数据详情
* @name :info
* @author :lyh
* @method :post
* @time :2023/8/17 16:42
*/
public function info(Request $request, ProjectLogic $logic){
$request->validate([
'id'=>'required'
... ... @@ -82,6 +90,13 @@ class ProjectController extends BaseController
$this->response('success',Code::SUCCESS,$data);
}
/**
* @remark :保存数据
* @name :save
* @author :lyh
* @method :post
* @time :2023/8/17 16:42
*/
public function save(ProjectRequest $request, ProjectLogic $logic)
{
$data = $logic->save($this->param);
... ...
... ... @@ -13,7 +13,6 @@ class DomainInfoLogic extends BaseLogic
public function __construct()
{
parent::__construct();
$this->model = new DomainInfo();
}
... ...
... ... @@ -109,13 +109,17 @@ class ProjectLogic extends BaseLogic
* @time :2023/7/28 17:11
*/
public function getProjectInfo($id){
$info = $this->model->with('payment')->with('deploy_build')
->with('deploy_optimize')->with('online_check')
->with('project_after')->where(['id'=>$id])->first();
$info['online_check']['name'] = (new Manage())->read(['id'=>$info['online_check']['created_manage_id']])['name'] ?? '';
$info['deploy_optimize']['minor_keywords'] = json_decode($info['deploy_optimize']['minor_keywords']) ?? '';
if($info['extend_type'] != 0){
$info['type'] = $info['extend_type'];
$info = Common::get_user_cache($this->model,$id);
if(empty($info)){
$info = $this->model->with('payment')->with('deploy_build')
->with('deploy_optimize')->with('online_check')
->with('project_after')->where(['id'=>$id])->first();
$info['online_check']['name'] = (new Manage())->read(['id'=>$info['online_check']['created_manage_id']])['name'] ?? '';
$info['deploy_optimize']['minor_keywords'] = json_decode($info['deploy_optimize']['minor_keywords']) ?? '';
if($info['extend_type'] != 0){
$info['type'] = $info['extend_type'];
}
Common::set_user_cache($info,$this->model,$id);
}
return $this->success($info);
}
... ... @@ -140,6 +144,7 @@ class ProjectLogic extends BaseLogic
$this->saveDeployBuild($param);
$this->saveDeployOptimize($param);
$this->saveAfter($param);
Common::del_user_cache($this->model,$res['id']);
DB::commit();
}catch (\Exception $e){
DB::rollBack();
... ...