| 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,12 +226,12 @@ 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){
|
|
|
$user_agent->get_count++;
|
|
|
$user_agent->save();
|
|
|
- $agent = AlbumUserModel::where('id',$user_agent->user_id)->first();
|
|
|
+ $agent = AlbumUserModel::where([['id',$user_agent->user_id],['store_id',$datas['store_id']]])->first();
|
|
|
try{
|
|
|
$this->sendLogsMessage($datas['store_id'],$agent->open_id,4,$userAuth->username,$agent->g_open_id);
|
|
|
}catch (\Exception $e){
|