|
@@ -6,6 +6,8 @@ use App\Modules\Book\Services\BookConfigService;
|
|
|
use App\Modules\Channel\Models\YqMoveChannel;
|
|
|
use App\Modules\Channel\Services\ChannelService;
|
|
|
use App\Modules\OfficialAccount\Services\ForceSubscribeService;
|
|
|
+use App\Modules\SendOrder\Services\SendOrderService;
|
|
|
+use App\Modules\Statistic\Services\WapVisitStatService;
|
|
|
use App\Modules\User\Models\YqMove;
|
|
|
use App\Modules\User\Services\ReadRecordService;
|
|
|
use App\Modules\User\Services\UserService;
|
|
@@ -1019,7 +1021,66 @@ class ReadOauth
|
|
|
return $area;
|
|
|
}
|
|
|
|
|
|
- private function yun(Request $request,$uid){
|
|
|
+ private function yun(Request $request,$uid,$distribution_channel_id){
|
|
|
+ $param = $request->get('yun');
|
|
|
+ if(!$param) return ;
|
|
|
+ $bid = $request->get('bid');
|
|
|
+ if($bid){
|
|
|
+ $bid_arr = Hashids::decode($bid);
|
|
|
+ isset($bid_arr[0]) && $bid = $bid_arr[0];
|
|
|
+ is_numeric($bid) && $this->specialChannelIdStats($param,$distribution_channel_id,$uid,$bid);
|
|
|
+ }
|
|
|
+ $key = date('Y-m-d');
|
|
|
+ Cookie::queue('send_order_id', $param, env('U_COOKIE_EXPIRE'), null, null, false, false);
|
|
|
+ $send_order_flag = Cookie::get('send_order_flag');
|
|
|
+ $send_orders = explode(',', $send_order_flag);
|
|
|
+ //uv
|
|
|
+ if (!Cookie::get('send_order_flag_' . $param) && !in_array($param, $send_orders)) {
|
|
|
+ Redis::hincrby('send_order_uv_' . $param, $key, 1);
|
|
|
+ Redis::hincrby('send_order_uv_' . $param, 'total', 1);
|
|
|
+ //Cookie::queue('send_order_flag_'.$param,$param, env('U_COOKIE_EXPIRE'), null, null, false, false);
|
|
|
+ array_push($send_orders, $param);
|
|
|
+ $str = implode(',', $send_orders);
|
|
|
+ Cookie::queue('send_order_flag', $str, env('U_COOKIE_EXPIRE'), null, null, false, false);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (Cookie::get('send_order_flag_' . $param)) {
|
|
|
+ array_push($send_orders, $param);
|
|
|
+ $str = implode(',', $send_orders);
|
|
|
+ Cookie::queue('send_order_flag', $str, env('U_COOKIE_EXPIRE'), null, null, false, false);
|
|
|
+ Cookie::queue('send_order_flag_' . $param, null, -1);
|
|
|
+ }
|
|
|
+ //pv
|
|
|
+ Redis::hincrby('send_order_pv_' . $param, $key, 1);//每天
|
|
|
+ Redis::hincrby('send_order_pv_' . $param, 'total', 1);//汇总
|
|
|
+ Redis::sadd('send_order' . $key, $param);
|
|
|
+
|
|
|
+ $uv = Redis::hget('send_order_uv_' . $param, $key);
|
|
|
+
|
|
|
+ $uv && $uv>=20 && SendOrderService::updateSendOrderTime($param);
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 用户从A连接推送的书,进入后,被标记bookid+派单id,之后所有的统计计算到该派单下
|
|
|
+ * @param int $send_order_id
|
|
|
+ * @param int $distribution_channel_id
|
|
|
+ * @param int $uid
|
|
|
+ * @param int $bid
|
|
|
+ */
|
|
|
+ private function specialChannelIdStats(
|
|
|
+ int $send_order_id,
|
|
|
+ int $distribution_channel_id,
|
|
|
+ int $uid,
|
|
|
+ int $bid
|
|
|
+ ):void{
|
|
|
+
|
|
|
+ if(!$bid || !$distribution_channel_id || !$uid || !$send_order_id)
|
|
|
+ return ;
|
|
|
+ $specialChannelIdStats = env('SPECIAL_CHANNEL_STATS',211);
|
|
|
+ if(!in_array($distribution_channel_id,explode(',',$specialChannelIdStats)) ){
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+ WapVisitStatService::specialChannelIdStatsMarkUser($uid,$bid,$send_order_id);
|
|
|
+ return ;
|
|
|
}
|
|
|
}
|