作者 lyh

gx

@@ -71,6 +71,10 @@ class BTemplateController extends BaseController @@ -71,6 +71,10 @@ class BTemplateController extends BaseController
71 * @time :2023/6/29 10:02 71 * @time :2023/6/29 10:02
72 */ 72 */
73 public function save(TemplateRequest $templateRequest,BTemplateLogic $BTemplateLogic){ 73 public function save(TemplateRequest $templateRequest,BTemplateLogic $BTemplateLogic){
  74 + //演示项目,不允许其他号码编辑
  75 + if(($this->user['project_id'] == 1) && ($this->user['mobile'] != '15928018676')){
  76 + $this->response('演示项目不允许编辑',Code::USER_ERROR);
  77 + }
74 $templateRequest->validated(); 78 $templateRequest->validated();
75 $BTemplateLogic->templateSave(); 79 $BTemplateLogic->templateSave();
76 $this->response('success'); 80 $this->response('success');
@@ -48,24 +48,19 @@ class ProjectLogic extends BaseLogic @@ -48,24 +48,19 @@ class ProjectLogic extends BaseLogic
48 * @time :2023/7/28 17:11 48 * @time :2023/7/28 17:11
49 */ 49 */
50 public function getProjectInfo($id){ 50 public function getProjectInfo($id){
51 -// $info = Common::get_user_cache($this->model->getTable(),$id);  
52 -// if(empty($info)){  
53 - $info = $this->model->with('payment')->with('deploy_build')->with('deploy_optimize')->with('online_check')  
54 - ->with('project_after')->where(['id'=>$id])->first()->toArray();  
55 - if(!empty($info['online_check']['created_manage_id'])){  
56 - $info['online_check']['name'] = (new Manage())->read(['id'=>$info['online_check']['created_manage_id']])['name'] ?? '';  
57 - }  
58 -  
59 - if(isset($info['deploy_optimize']['minor_keywords']) && !empty($info['deploy_optimize']['minor_keywords'])){  
60 - $info['deploy_optimize']['minor_keywords'] = json_decode($info['deploy_optimize']['minor_keywords']) ?? '';  
61 - }else{  
62 - $info['deploy_optimize']['minor_keywords'] = [];  
63 - }  
64 - if($info['extend_type'] != 0){  
65 - $info['type'] = $info['extend_type'];  
66 - }  
67 -// Common::set_user_cache($info,$this->model->getTable(),$id);  
68 -// } 51 + $info = $this->model->with('payment')->with('deploy_build')->with('deploy_optimize')->with('online_check')
  52 + ->with('project_after')->where(['id'=>$id])->first()->toArray();
  53 + if(!empty($info['online_check']['created_manage_id'])){
  54 + $info['online_check']['name'] = (new Manage())->read(['id'=>$info['online_check']['created_manage_id']])['name'] ?? '';
  55 + }
  56 + if(isset($info['deploy_optimize']['minor_keywords']) && !empty($info['deploy_optimize']['minor_keywords'])){
  57 + $info['deploy_optimize']['minor_keywords'] = json_decode($info['deploy_optimize']['minor_keywords']) ?? '';
  58 + }else{
  59 + $info['deploy_optimize']['minor_keywords'] = [];
  60 + }
  61 + if($info['extend_type'] != 0){
  62 + $info['type'] = $info['extend_type'];
  63 + }
69 return $this->success($info); 64 return $this->success($info);
70 } 65 }
71 66
@@ -165,6 +160,9 @@ class ProjectLogic extends BaseLogic @@ -165,6 +160,9 @@ class ProjectLogic extends BaseLogic
165 */ 160 */
166 protected function saveProjectDeployBuild($deploy_build){ 161 protected function saveProjectDeployBuild($deploy_build){
167 $deployBuildModel = new DeployBuild(); 162 $deployBuildModel = new DeployBuild();
  163 + if(isset($deploy_build['configuration']) && !empty($deploy_build['configuration'])){
  164 + $deploy_build['configuration'] = Arr::a2s($deploy_build['configuration']);
  165 + }
168 $deployBuildModel->edit($deploy_build,['id'=>$deploy_build['id']]); 166 $deployBuildModel->edit($deploy_build,['id'=>$deploy_build['id']]);
169 return $this->success(); 167 return $this->success();
170 } 168 }
@@ -17,4 +17,17 @@ class DeployBuild extends Base @@ -17,4 +17,17 @@ class DeployBuild extends Base
17 $cache_key = 'project_' . $row->original['test_domain']; 17 $cache_key = 'project_' . $row->original['test_domain'];
18 Cache::forget($cache_key); 18 Cache::forget($cache_key);
19 } 19 }
  20 +
  21 + /**
  22 + * @remark :扩展字段获取器
  23 + * @name :getConfigurationAttribute
  24 + * @author :lyh
  25 + * @method :post
  26 + * @time :2023/9/6 9:44
  27 + */
  28 + public function getConfigurationAttribute($value)
  29 + {
  30 + $value = Arr::s2a($value);
  31 + return $value;
  32 + }
20 } 33 }