|
...
|
...
|
@@ -25,20 +25,22 @@ class AyrShareController extends BaseController |
|
|
|
public function lists(AyrShareModel $ayrShareModel,AyrShareLogic $ayrShareLogic){
|
|
|
|
//授权配置列表
|
|
|
|
$share_list = $ayrShareModel->platforms;
|
|
|
|
$lists = $ayrShareModel->lists($this->map,$this->page,$this->row,'id',['id','name','title','profile_key','bind_plat_from','operator_id','created_at','updated_at']);
|
|
|
|
$lists = $ayrShareModel->lists($this->map,$this->page,$this->row,'id',['id','name','title','profile_key','bind_platforms','operator_id','created_at','updated_at']);
|
|
|
|
foreach ($lists['list'] as $k => $v){
|
|
|
|
if(!empty($v['profile_key'])){
|
|
|
|
$ayrShareHelper = new AyrShareHelper();
|
|
|
|
$share_info = $ayrShareHelper->get_profiles_users($v['profile_key']);
|
|
|
|
if(isset($share_info['activeSocialAccounts'])){
|
|
|
|
$str = json_encode($share_info['activeSocialAccounts']);
|
|
|
|
if($str != $v['bind_plat_from']){
|
|
|
|
$ayrShareLogic->ayr_share_edit(['bind_plat_from'=>$str]);
|
|
|
|
if($str != $v['bind_platforms']){
|
|
|
|
$ayrShareLogic->ayr_share_edit(['bind_platforms'=>$str],$v['id']);
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
$ayrShareLogic->ayr_share_edit(['bind_platforms'=>''],$v['id']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$lists['share_list'] = $share_list;
|
|
|
|
$lists['list']['share_list'] = $share_list;
|
|
|
|
$this->response('列表',Code::SUCCESS,$lists);
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -59,11 +61,13 @@ class AyrShareController extends BaseController |
|
|
|
$share_info = $ayrShareHelper->get_profiles_users($info['profile_key']);
|
|
|
|
if(isset($share_info['activeSocialAccounts'])){
|
|
|
|
$str = json_encode($share_info['activeSocialAccounts']);
|
|
|
|
if($str != $info['bind_plat_from']){
|
|
|
|
$res = $ayrShareLogic->ayr_share_edit(['bind_plat_from'=>$str]);
|
|
|
|
if($str != $info['bind_platforms']){
|
|
|
|
$res = $ayrShareLogic->ayr_share_edit(['bind_platforms'=>$str],$this->param['share_id']);
|
|
|
|
}else{
|
|
|
|
$res = false;
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
$res = $ayrShareLogic->ayr_share_edit(['bind_platforms'=>''],$this->param['share_id']);
|
|
|
|
}
|
|
|
|
$this->response('success',Code::SUCCESS,['is_true'=>$res]);
|
|
|
|
}
|
...
|
...
|
|