作者 lyh

gx

... ... @@ -71,6 +71,10 @@ class BTemplateController extends BaseController
* @time :2023/6/29 10:02
*/
public function save(TemplateRequest $templateRequest,BTemplateLogic $BTemplateLogic){
//演示项目,不允许其他号码编辑
if(($this->user['project_id'] == 1) && ($this->user['mobile'] != '15928018676')){
$this->response('演示项目不允许编辑',Code::USER_ERROR);
}
$templateRequest->validated();
$BTemplateLogic->templateSave();
$this->response('success');
... ...
... ... @@ -48,14 +48,11 @@ class ProjectLogic extends BaseLogic
* @time :2023/7/28 17:11
*/
public function getProjectInfo($id){
// $info = Common::get_user_cache($this->model->getTable(),$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()->toArray();
if(!empty($info['online_check']['created_manage_id'])){
$info['online_check']['name'] = (new Manage())->read(['id'=>$info['online_check']['created_manage_id']])['name'] ?? '';
}
if(isset($info['deploy_optimize']['minor_keywords']) && !empty($info['deploy_optimize']['minor_keywords'])){
$info['deploy_optimize']['minor_keywords'] = json_decode($info['deploy_optimize']['minor_keywords']) ?? '';
}else{
... ... @@ -64,8 +61,6 @@ class ProjectLogic extends BaseLogic
if($info['extend_type'] != 0){
$info['type'] = $info['extend_type'];
}
// Common::set_user_cache($info,$this->model->getTable(),$id);
// }
return $this->success($info);
}
... ... @@ -165,6 +160,9 @@ class ProjectLogic extends BaseLogic
*/
protected function saveProjectDeployBuild($deploy_build){
$deployBuildModel = new DeployBuild();
if(isset($deploy_build['configuration']) && !empty($deploy_build['configuration'])){
$deploy_build['configuration'] = Arr::a2s($deploy_build['configuration']);
}
$deployBuildModel->edit($deploy_build,['id'=>$deploy_build['id']]);
return $this->success();
}
... ...
... ... @@ -17,4 +17,17 @@ class DeployBuild extends Base
$cache_key = 'project_' . $row->original['test_domain'];
Cache::forget($cache_key);
}
/**
* @remark :扩展字段获取器
* @name :getConfigurationAttribute
* @author :lyh
* @method :post
* @time :2023/9/6 9:44
*/
public function getConfigurationAttribute($value)
{
$value = Arr::s2a($value);
return $value;
}
}
... ...