| xqd
@@ -289,25 +289,25 @@ class AlbumController extends Controller
|
|
|
if (Auth::loginUsingId($check->id)) {
|
|
|
$userAuth = Auth::user();
|
|
|
if($check->is_dealer ==0){
|
|
|
- print_r(33);
|
|
|
if($request->input('agent_id')!=0){
|
|
|
$userAuth->up_agent_id = $request->input('agent_id');
|
|
|
}
|
|
|
- print_r($request->input('agent_id'));
|
|
|
$add_record['agent_id'] = $request->input('agent_id');
|
|
|
$add_record['open_id'] = $check->wechat_open_id;
|
|
|
$add_record['action'] = 4;
|
|
|
$add_record['store_id'] = $datas['store_id'];
|
|
|
$add_record['detail'] = null;
|
|
|
- print_r(22);die;
|
|
|
AlbumWatchRecord::create($add_record);
|
|
|
$user_agent = AlbumAgentModel::where('id',$add_record['agent_id'])->first();
|
|
|
- $agent = AlbumUserModel::where('id',$user_agent->user_id)->first();
|
|
|
- try{
|
|
|
- $this->sendLogsMessage($datas['store_id'],$agent->wechat_open_id,4,$userAuth->username);
|
|
|
- }catch (\Exception $e){
|
|
|
+ if($user_agent){
|
|
|
+ $agent = AlbumUserModel::where('id',$user_agent->user_id)->first();
|
|
|
+ try{
|
|
|
+ $this->sendLogsMessage($datas['store_id'],$agent->wechat_open_id,4,$userAuth->username);
|
|
|
+ }catch (\Exception $e){
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}else{
|
|
|
$userAuth->up_agent_id = 0;
|
|
|
}
|