|
@@ -2,7 +2,6 @@
|
|
|
|
|
|
namespace App\Http\Controllers\Wap\Web;
|
|
namespace App\Http\Controllers\Wap\Web;
|
|
|
|
|
|
-use App\Admin\Models\Product;
|
|
|
|
use App\Jobs\SendStatisticsList;
|
|
use App\Jobs\SendStatisticsList;
|
|
use App\Jobs\SendTexts;
|
|
use App\Jobs\SendTexts;
|
|
use App\Modules\Activity\Services\ActivitySwitchService;
|
|
use App\Modules\Activity\Services\ActivitySwitchService;
|
|
@@ -14,6 +13,7 @@ use App\Modules\OfficialAccount\Services\ForceSubscribeService;
|
|
use App\Modules\Statistic\Services\DataAnalysisSelectUserService;
|
|
use App\Modules\Statistic\Services\DataAnalysisSelectUserService;
|
|
use App\Modules\Subscribe\Services\OrderService;
|
|
use App\Modules\Subscribe\Services\OrderService;
|
|
use App\Modules\User\Services\ForceSubscribeUserIService;
|
|
use App\Modules\User\Services\ForceSubscribeUserIService;
|
|
|
|
+use App\Modules\User\Services\UserDivisionCpcPropertyService;
|
|
use App\Modules\User\Services\UserDivisionPropertyService;
|
|
use App\Modules\User\Services\UserDivisionPropertyService;
|
|
use App\Modules\User\Services\UserService;
|
|
use App\Modules\User\Services\UserService;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Request;
|
|
@@ -101,7 +101,7 @@ class WelcomeController extends BaseController
|
|
$ad_status = env('AD_STATUS', 1);
|
|
$ad_status = env('AD_STATUS', 1);
|
|
$adTargetId = false;
|
|
$adTargetId = false;
|
|
if ($ad_status) {
|
|
if ($ad_status) {
|
|
- $adTargetId = $this->cpcAd();
|
|
|
|
|
|
+ $adTargetId = $this->cpcAd($user->openid);
|
|
}
|
|
}
|
|
//广告frame
|
|
//广告frame
|
|
$is_show_ad_frame_setting = env('IS_SHOW_AD_FRAME_SETTING', '123');
|
|
$is_show_ad_frame_setting = env('IS_SHOW_AD_FRAME_SETTING', '123');
|
|
@@ -270,7 +270,8 @@ class WelcomeController extends BaseController
|
|
$outstanding_year_order = false;
|
|
$outstanding_year_order = false;
|
|
if( in_array($this->distribution_channel_id,explode(',',env('OUTSTANDING_YEAR_ORDER_SITE'))) ){
|
|
if( in_array($this->distribution_channel_id,explode(',',env('OUTSTANDING_YEAR_ORDER_SITE'))) ){
|
|
if($this->uid%2 == 0){
|
|
if($this->uid%2 == 0){
|
|
- $userDivisionProperty = UserDivisionPropertyService::getUserProperty($this->uid);
|
|
|
|
|
|
+ //$userDivisionProperty = UserDivisionPropertyService::getUserProperty($this->uid);
|
|
|
|
+ $userDivisionProperty = UserDivisionCpcPropertyService::getUserProperty($this->uid);
|
|
\Log::info('$userDivisionProperty is :'.$userDivisionProperty);
|
|
\Log::info('$userDivisionProperty is :'.$userDivisionProperty);
|
|
$userDivisionProperty && $userDivisionProperty == 'high' && $outstanding_year_order = true;
|
|
$userDivisionProperty && $userDivisionProperty == 'high' && $outstanding_year_order = true;
|
|
}
|
|
}
|
|
@@ -522,11 +523,16 @@ class WelcomeController extends BaseController
|
|
}
|
|
}
|
|
|
|
|
|
//CPC广告的优化逻辑
|
|
//CPC广告的优化逻辑
|
|
- private function cpcAd(){
|
|
|
|
|
|
+ private function cpcAd($openid){
|
|
if(in_array($this->distribution_channel_id,[2,5,8,14,123,146,148,155,160,196,202,211,255,256,266,271,273,318,691,695,722,4025,4053,4174,4236,4237,4241,4334,4364,4426,4427,4487,4488,4593,4742,4889,4891,5204])){
|
|
if(in_array($this->distribution_channel_id,[2,5,8,14,123,146,148,155,160,196,202,211,255,256,266,271,273,318,691,695,722,4025,4053,4174,4236,4237,4241,4334,4364,4426,4427,4487,4488,4593,4742,4889,4891,5204])){
|
|
$cookie_ad_status = Cookie::get('cpc_ad_status');
|
|
$cookie_ad_status = Cookie::get('cpc_ad_status');
|
|
if($cookie_ad_status) return $cookie_ad_status == 'show';
|
|
if($cookie_ad_status) return $cookie_ad_status == 'show';
|
|
- if(UserService::isCpcUser($this->uid)){
|
|
|
|
|
|
+ $property = UserDivisionCpcPropertyService::userLevel($openid);
|
|
|
|
+ /*if(UserService::isCpcUser($this->uid)){
|
|
|
|
+ Cookie::queue('cpc_ad_status', 'show');
|
|
|
|
+ return true;
|
|
|
|
+ }*/
|
|
|
|
+ if($property && $property->property == 'none'){
|
|
Cookie::queue('cpc_ad_status', 'show');
|
|
Cookie::queue('cpc_ad_status', 'show');
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
@@ -2027,16 +2033,19 @@ class WelcomeController extends BaseController
|
|
|
|
|
|
|
|
|
|
private function userPproperty($openid){
|
|
private function userPproperty($openid){
|
|
|
|
+ $old = UserDivisionCpcPropertyService::userLevel($openid);
|
|
|
|
+ if(!$old) return ;
|
|
|
|
+ if($old->type != 'NEW') return ;
|
|
|
|
+ $send_data = array(
|
|
|
|
+ 'type' => 'visit',
|
|
|
|
+ 'data' => ['openid'=>$openid,'uid'=>$this->uid]
|
|
|
|
+ );
|
|
try {
|
|
try {
|
|
- $send_data = array(
|
|
|
|
- 'type' => 'visit',
|
|
|
|
- 'data' => ['openid'=>$openid,'uid'=>$this->uid]
|
|
|
|
- );
|
|
|
|
$send = new SendStatisticsList($send_data);
|
|
$send = new SendStatisticsList($send_data);
|
|
$job = ($send)->onConnection('rabbitmq')->delay(0)->onQueue('send_statistics_list');
|
|
$job = ($send)->onConnection('rabbitmq')->delay(0)->onQueue('send_statistics_list');
|
|
dispatch($job);
|
|
dispatch($job);
|
|
} catch (\Exception $e) {
|
|
} catch (\Exception $e) {
|
|
- Log::info($e);
|
|
|
|
|
|
+ \Log::info($e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|