作者 lyh

更新发布验证

@@ -27,18 +27,16 @@ class AyrShareController extends BaseController @@ -27,18 +27,16 @@ class AyrShareController extends BaseController
27 $share_list = $ayrShareModel->platforms; 27 $share_list = $ayrShareModel->platforms;
28 $lists = $ayrShareModel->lists($this->map,$this->page,$this->row,'id',['id','name','title','profile_key','bind_platforms','operator_id','created_at','updated_at']); 28 $lists = $ayrShareModel->lists($this->map,$this->page,$this->row,'id',['id','name','title','profile_key','bind_platforms','operator_id','created_at','updated_at']);
29 foreach ($lists['list'] as $k => $v){ 29 foreach ($lists['list'] as $k => $v){
30 -// if(!empty($v['profile_key'])){  
31 -// $ayrShareHelper = new AyrShareHelper();  
32 -// $share_info = $ayrShareHelper->get_profiles_users($v['profile_key']);  
33 -// if(isset($share_info['activeSocialAccounts'])){  
34 -// $str = json_encode($share_info['activeSocialAccounts']);  
35 -// if($str != $v['bind_platforms']){  
36 -// $ayrShareLogic->ayr_share_edit(['bind_platforms'=>$str]);  
37 -// }  
38 -// }  
39 -// }  
40 - $str = json_encode(["facebook","fbg","gmb","instagram","linkedin","pinterest","reddit","telegram","tiktok","twitter","youtube"]);  
41 - $ayrShareLogic->ayr_share_edit(['bind_platforms'=>$str],$v['id']); 30 + if(!empty($v['profile_key'])){
  31 + $ayrShareHelper = new AyrShareHelper();
  32 + $share_info = $ayrShareHelper->get_profiles_users($v['profile_key']);
  33 + if(isset($share_info['activeSocialAccounts'])){
  34 + $str = json_encode($share_info['activeSocialAccounts']);
  35 + if($str != $v['bind_platforms']){
  36 + $ayrShareLogic->ayr_share_edit(['bind_platforms'=>$str]);
  37 + }
  38 + }
  39 + }
42 } 40 }
43 $lists['list']['share_list'] = $share_list; 41 $lists['list']['share_list'] = $share_list;
44 $this->response('列表',Code::SUCCESS,$lists); 42 $this->response('列表',Code::SUCCESS,$lists);
@@ -62,7 +60,7 @@ class AyrShareController extends BaseController @@ -62,7 +60,7 @@ class AyrShareController extends BaseController
62 if(isset($share_info['activeSocialAccounts'])){ 60 if(isset($share_info['activeSocialAccounts'])){
63 $str = json_encode($share_info['activeSocialAccounts']); 61 $str = json_encode($share_info['activeSocialAccounts']);
64 if($str != $info['bind_platforms']){ 62 if($str != $info['bind_platforms']){
65 - $res = $ayrShareLogic->ayr_share_edit(['bind_platforms'=>$str]); 63 + $res = $ayrShareLogic->ayr_share_edit(['bind_platforms'=>$str],$this->param['share_id']);
66 }else{ 64 }else{
67 $res = false; 65 $res = false;
68 } 66 }
@@ -84,9 +84,6 @@ class AyrShareLogic extends BaseLogic @@ -84,9 +84,6 @@ class AyrShareLogic extends BaseLogic
84 * @time :2023/5/9 14:44 84 * @time :2023/5/9 14:44
85 */ 85 */
86 public function ayr_share_edit($param,$id = ''){ 86 public function ayr_share_edit($param,$id = ''){
87 - if(isset($this->param['id'])){  
88 - $id = $this->param['id'];  
89 - }  
90 $rs = $this->model->edit($param,['id'=>$id]); 87 $rs = $this->model->edit($param,['id'=>$id]);
91 if($rs === false){ 88 if($rs === false){
92 $this->fail('error'); 89 $this->fail('error');