作者 lyh

变更数据

@@ -155,6 +155,7 @@ class FetchTicketProjects extends Command @@ -155,6 +155,7 @@ class FetchTicketProjects extends Command
155 'wechat_group_id' => $item['wx_id'], 155 'wechat_group_id' => $item['wx_id'],
156 'team' => $team_ids ? json_encode($team_ids) : null, 156 'team' => $team_ids ? json_encode($team_ids) : null,
157 'flg_show'=>$item['flg_show'] ?? 1, 157 'flg_show'=>$item['flg_show'] ?? 1,
  158 + 'split'=>$item['split'] ?? 0,
158 ]; 159 ];
159 if (!$project) { 160 if (!$project) {
160 $new = new TicketProject(); 161 $new = new TicketProject();
@@ -52,9 +52,8 @@ class Ticket5UploadDataController extends BaseController @@ -52,9 +52,8 @@ class Ticket5UploadDataController extends BaseController
52 if($projectInfo === false){ 52 if($projectInfo === false){
53 $this->response('当前项目不存在或数据未同步',Code::SYSTEM_ERROR); 53 $this->response('当前项目不存在或数据未同步',Code::SYSTEM_ERROR);
54 } 54 }
55 - //todo::目前写死  
56 - if($projectInfo['website'] != 'https://www.lstchocolatemachine.com/'){  
57 - $this->response('当前项目不允许操作',Code::SYSTEM_ERROR); 55 + if(isset($projectInfo['split']) && $projectInfo['split'] == 1){
  56 + $projectInfo['website'] = $projectInfo['test_website'] ?? '';
58 } 57 }
59 $action = $project5CateModel->getCateTypeAction($this->param['type']); 58 $action = $project5CateModel->getCateTypeAction($this->param['type']);
60 if(empty($action)){ 59 if(empty($action)){
@@ -105,11 +104,10 @@ class Ticket5UploadDataController extends BaseController @@ -105,11 +104,10 @@ class Ticket5UploadDataController extends BaseController
105 if($projectInfo === false){ 104 if($projectInfo === false){
106 $this->response('当前项目不存在或数据未同步',Code::SYSTEM_ERROR); 105 $this->response('当前项目不存在或数据未同步',Code::SYSTEM_ERROR);
107 } 106 }
108 - $project5CateModel = new Project5Cate();  
109 - //todo::目前写死,上线放开  
110 - if($projectInfo['website'] != 'https://www.lstchocolatemachine.com/'){  
111 - $this->response('当前项目不允许操作',Code::SYSTEM_ERROR); 107 + if(isset($projectInfo['split']) && $projectInfo['split'] == 1){
  108 + $projectInfo['website'] = $projectInfo['test_website'] ?? '';
112 } 109 }
  110 + $project5CateModel = new Project5Cate();
113 $action = $project5CateModel->saveCateTypeAction($this->param['type']); 111 $action = $project5CateModel->saveCateTypeAction($this->param['type']);
114 $url = $projectInfo['website'].'wp-admin/admin-ajax.php?action='.$action; 112 $url = $projectInfo['website'].'wp-admin/admin-ajax.php?action='.$action;
115 if(empty($action)){ 113 if(empty($action)){
@@ -169,7 +167,7 @@ class Ticket5UploadDataController extends BaseController @@ -169,7 +167,7 @@ class Ticket5UploadDataController extends BaseController
169 } 167 }
170 //验证当前数据是否已提交 168 //验证当前数据是否已提交
171 $this->param['text'] = json_encode($this->param['text'], true); 169 $this->param['text'] = json_encode($this->param['text'], true);
172 -// $this->pushTicketByBots($this->param['post_id'],$this->param['project_type']); 170 + $this->pushTicketByBots($this->param['post_id'],$this->param['project_type']);
173 if(isset($this->param['id']) && !empty($this->param['id'])){ 171 if(isset($this->param['id']) && !empty($this->param['id'])){
174 //执行编辑 172 //执行编辑
175 $info = $this->model->read(['id'=>$this->param['id']]); 173 $info = $this->model->read(['id'=>$this->param['id']]);
@@ -183,8 +183,8 @@ class TicketUploadDataLogic extends BaseLogic @@ -183,8 +183,8 @@ class TicketUploadDataLogic extends BaseLogic
183 if($projectInfo === false){ 183 if($projectInfo === false){
184 $this->fail('当前项目不存在或数据未同步'); 184 $this->fail('当前项目不存在或数据未同步');
185 } 185 }
186 - if($projectInfo['website'] != 'https://www.lstchocolatemachine.com/'){  
187 - $this->fail('当前项目不允许操作'); 186 + if(isset($projectInfo['split']) && $projectInfo['split'] == 1){
  187 + $projectInfo['website'] = $projectInfo['test_website'] ?? '';
188 } 188 }
189 $action = $this->model->saveAction($info['type']); 189 $action = $this->model->saveAction($info['type']);
190 $url = $projectInfo['website'].'wp-admin/admin-ajax.php?action='.$action; 190 $url = $projectInfo['website'].'wp-admin/admin-ajax.php?action='.$action;