| xqd
@@ -157,9 +157,9 @@ class AlbumController extends Controller
|
|
|
$session = $res['session_key'];
|
|
|
$decryptedData = $app->encryptor->decryptData($session, $datas['iv'], $datas['encryptData']);
|
|
|
if (!isset($decryptedData['unionId'])) {
|
|
|
- $check = AlbumUserModel::where('open_id', $res['openid'])->first();
|
|
|
+ $check = AlbumUserModel::where([['open_id', $res['openid']],['store_id',$datas['store_id']]])->first();
|
|
|
} else {
|
|
|
- $check = AlbumUserModel::where('wechat_union_id', $decryptedData['unionId'])->first();
|
|
|
+ $check = AlbumUserModel::where([['wechat_union_id', $decryptedData['unionId']],['store_id',$datas['store_id']]])->first();
|
|
|
}
|
|
|
|
|
|
if(!$check){
|
| xqd
@@ -226,17 +226,13 @@ class AlbumController extends Controller
|
|
|
AlbumWatchRecord::create($add_record);
|
|
|
// dd($add_record);
|
|
|
// print_r($add_record['agent_id']);die;
|
|
|
- $user_agent = AlbumAgentModel::where('id',$add_record['agent_id'])->first();
|
|
|
+ $user_agent = AlbumAgentModel::where([['id',$add_record['agent_id']],['store_id',$datas['store_id']]])->first();
|
|
|
//dd($user_agent);
|
|
|
- if($user_agent){
|
|
|
+ if ($user_agent) {
|
|
|
$user_agent->get_count++;
|
|
|
$user_agent->save();
|
|
|
- $agent = AlbumUserModel::where('id',$user_agent->user_id)->first();
|
|
|
- try{
|
|
|
- $this->sendLogsMessage($datas['store_id'],$agent->open_id,4,$userAuth->username,$agent->g_open_id);
|
|
|
- }catch (\Exception $e){
|
|
|
-
|
|
|
- }
|
|
|
+ $agent = AlbumUserModel::where([['id',$user_agent->user_id],['store_id',$datas['store_id']]])->first();
|
|
|
+ $this->sendLogsMessage($datas['store_id'], $agent->open_id, 4, $userAuth->username, $agent->g_open_id);
|
|
|
}else{
|
|
|
$userAuth->up_agent_id = 0;
|
|
|
}
|
| xqd
@@ -1935,6 +1931,8 @@ class AlbumController extends Controller
|
|
|
}
|
|
|
$data['status'] = 0;
|
|
|
$data['user_id'] = $userAuth->id;
|
|
|
+ $data['lon'] = $res['result']['location']['lng'];
|
|
|
+ $data['lat'] = $res['result']['location']['lat'];
|
|
|
$data['name'] = $userAuth->username;
|
|
|
$res = AlbumAgentModel::create($data);
|
|
|
if($res){
|