|
@@ -44,6 +44,7 @@ class WelcomeController extends BaseController
|
|
private $property = '';
|
|
private $property = '';
|
|
|
|
|
|
private $user = null;
|
|
private $user = null;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 首页
|
|
* 首页
|
|
*/
|
|
*/
|
|
@@ -109,9 +110,9 @@ class WelcomeController extends BaseController
|
|
$this->setProperty($user->openid);
|
|
$this->setProperty($user->openid);
|
|
$channel_activities_flag = $this->judgeChannelActivity($user);
|
|
$channel_activities_flag = $this->judgeChannelActivity($user);
|
|
//最近阅读页面 推荐
|
|
//最近阅读页面 推荐
|
|
- if(isset($user->sex)){
|
|
|
|
|
|
+ if (isset($user->sex)) {
|
|
$latest_read_rec_books = $this->latest_read_rec_books($channel, $user->sex);
|
|
$latest_read_rec_books = $this->latest_read_rec_books($channel, $user->sex);
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
$latest_read_rec_books = [];
|
|
$latest_read_rec_books = [];
|
|
}
|
|
}
|
|
//广告样本
|
|
//广告样本
|
|
@@ -121,18 +122,18 @@ class WelcomeController extends BaseController
|
|
$adTargetId = $this->cpcAd($user->openid);
|
|
$adTargetId = $this->cpcAd($user->openid);
|
|
}
|
|
}
|
|
$cpc_channel = '';
|
|
$cpc_channel = '';
|
|
- if($adTargetId){
|
|
|
|
- $cpc_channel = Redis::hget('channel:setting:'.$this->distribution_channel_id,'cpc_channel');
|
|
|
|
- if(!$cpc_channel) $cpc_channel = 'zw005';
|
|
|
|
- $disable_channel = redisEnv('CPC_DISABLED_CHANNEL','');
|
|
|
|
- if($disable_channel && in_array($cpc_channel,explode(',',$disable_channel))){
|
|
|
|
|
|
+ if ($adTargetId) {
|
|
|
|
+ $cpc_channel = Redis::hget('channel:setting:' . $this->distribution_channel_id, 'cpc_channel');
|
|
|
|
+ if (!$cpc_channel) $cpc_channel = 'zw005';
|
|
|
|
+ $disable_channel = redisEnv('CPC_DISABLED_CHANNEL', '');
|
|
|
|
+ if ($disable_channel && in_array($cpc_channel, explode(',', $disable_channel))) {
|
|
$adTargetId = false;
|
|
$adTargetId = false;
|
|
$cpc_channel = '';
|
|
$cpc_channel = '';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//目前推喜阅 自有广告曝光中低净值
|
|
//目前推喜阅 自有广告曝光中低净值
|
|
$self_pa_ad_switch = 0;
|
|
$self_pa_ad_switch = 0;
|
|
- if(in_array($this->property,['none','low', 'medium']) && $this->isPddAdSites()) $self_pa_ad_switch = 1;
|
|
|
|
|
|
+ if (in_array($this->property, ['none', 'low', 'medium']) && $this->isPddAdSites()) $self_pa_ad_switch = 1;
|
|
|
|
|
|
|
|
|
|
//广告frame
|
|
//广告frame
|
|
@@ -150,25 +151,25 @@ class WelcomeController extends BaseController
|
|
$hide_chapter_channels = explode(',', env('HIDE_CHAPTER_CONSUME_CHANNEL'));
|
|
$hide_chapter_channels = explode(',', env('HIDE_CHAPTER_CONSUME_CHANNEL'));
|
|
$is_hide_chapter_consume = in_array($this->distribution_channel_id, $hide_chapter_channels) ? 1 : 0;
|
|
$is_hide_chapter_consume = in_array($this->distribution_channel_id, $hide_chapter_channels) ? 1 : 0;
|
|
//广告
|
|
//广告
|
|
-
|
|
|
|
|
|
+
|
|
// 屏蔽书名
|
|
// 屏蔽书名
|
|
- $self_config = ChannelService::check_channel_account_priv($this->distribution_channel_id,'hide_book_name');
|
|
|
|
|
|
+ $self_config = ChannelService::check_channel_account_priv($this->distribution_channel_id, 'hide_book_name');
|
|
$hide_book_name = 0;
|
|
$hide_book_name = 0;
|
|
- if(!empty($self_config)){
|
|
|
|
- $hide_book_name = 1;
|
|
|
|
|
|
+ if (!empty($self_config)) {
|
|
|
|
+ $hide_book_name = 1;
|
|
}
|
|
}
|
|
//原创pv uv
|
|
//原创pv uv
|
|
$yctj = false;
|
|
$yctj = false;
|
|
$yctj_url = '';
|
|
$yctj_url = '';
|
|
- if(in_array($this->distribution_channel_id,[2,146,155,255,691,722,4053,4174,4364,4426])){
|
|
|
|
|
|
+ if (in_array($this->distribution_channel_id, [2, 146, 155, 255, 691, 722, 4053, 4174, 4364, 4426])) {
|
|
$yctj = true;
|
|
$yctj = true;
|
|
$yctj_url = 'https://m.ycsd.cn/continueRead';
|
|
$yctj_url = 'https://m.ycsd.cn/continueRead';
|
|
}
|
|
}
|
|
//app广告
|
|
//app广告
|
|
- $add_ad_status=[
|
|
|
|
- 'appad'=>false,
|
|
|
|
- 'appad_banner'=>'',
|
|
|
|
- 'appad_url'=>''
|
|
|
|
|
|
+ $add_ad_status = [
|
|
|
|
+ 'appad' => false,
|
|
|
|
+ 'appad_banner' => '',
|
|
|
|
+ 'appad_url' => ''
|
|
];
|
|
];
|
|
|
|
|
|
//突出包年的充值页面
|
|
//突出包年的充值页面
|
|
@@ -176,24 +177,20 @@ class WelcomeController extends BaseController
|
|
$pdd_ad = $this->pddAd();
|
|
$pdd_ad = $this->pddAd();
|
|
|
|
|
|
//banner 合并
|
|
//banner 合并
|
|
- if($is_show_activity)
|
|
|
|
- {
|
|
|
|
|
|
+ if ($is_show_activity) {
|
|
$banners[] = [
|
|
$banners[] = [
|
|
- 'img'=>$activity_img,
|
|
|
|
- 'jump_url'=>$url
|
|
|
|
|
|
+ 'img' => $activity_img,
|
|
|
|
+ 'jump_url' => $url
|
|
];
|
|
];
|
|
}
|
|
}
|
|
//pdd 广告用户--增加banner
|
|
//pdd 广告用户--增加banner
|
|
- if($pdd_ad)
|
|
|
|
- {
|
|
|
|
|
|
+ if ($pdd_ad) {
|
|
$pdd_ads = Redis::get('pdd_ads');//pdd广告
|
|
$pdd_ads = Redis::get('pdd_ads');//pdd广告
|
|
- if($pdd_ads)
|
|
|
|
- {
|
|
|
|
- foreach (json_decode($pdd_ads,true) as $_ad)
|
|
|
|
- {
|
|
|
|
|
|
+ if ($pdd_ads) {
|
|
|
|
+ foreach (json_decode($pdd_ads, true) as $_ad) {
|
|
$banners[] = [
|
|
$banners[] = [
|
|
- 'img'=>$_ad['img'],
|
|
|
|
- 'jump_url'=>$_ad['jump_url']
|
|
|
|
|
|
+ 'img' => $_ad['img'],
|
|
|
|
+ 'jump_url' => $_ad['jump_url']
|
|
];
|
|
];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -233,24 +230,24 @@ class WelcomeController extends BaseController
|
|
'is_show_ad_frame' => $is_show_ad_frame,
|
|
'is_show_ad_frame' => $is_show_ad_frame,
|
|
'show_title_in_reader' => $show_title_in_reader,
|
|
'show_title_in_reader' => $show_title_in_reader,
|
|
'is_hide_chapter_consume' => $is_hide_chapter_consume,
|
|
'is_hide_chapter_consume' => $is_hide_chapter_consume,
|
|
- 'hide_book_name' => $hide_book_name,
|
|
|
|
- 'yctj'=>$yctj,
|
|
|
|
- 'yctj_url'=>$yctj_url,
|
|
|
|
- 'appad'=>$add_ad_status['appad'],
|
|
|
|
- 'appad_banner'=>$add_ad_status['appad_banner'],
|
|
|
|
- 'appad_url'=>$add_ad_status['appad_url'],
|
|
|
|
- 'outstanding_year_order'=>$outstanding_year_order,
|
|
|
|
- 'share_domain'=>env('share_domain_url'),
|
|
|
|
- 'share_switch'=>0,//无充值用户分享关闭
|
|
|
|
- 'pdd_ad'=>$pdd_ad,
|
|
|
|
- 'special_pay_template'=>$this->isMiWan(), //米玩站点特殊充值页面
|
|
|
|
- 'crm'=>$crm,
|
|
|
|
- 'self_pa_ad_switch'=>$self_pa_ad_switch,//自有平台广告开关
|
|
|
|
- 'banners'=>$banners,
|
|
|
|
- 'guidepersonalaccount'=>$this->guidePersonalAccount($user->openid),
|
|
|
|
- 'cpc_channel'=>$cpc_channel,
|
|
|
|
- 'month_order_info'=>$month_order_info,
|
|
|
|
- 'xiyue_info'=>$xiyue_info
|
|
|
|
|
|
+ 'hide_book_name' => $hide_book_name,
|
|
|
|
+ 'yctj' => $yctj,
|
|
|
|
+ 'yctj_url' => $yctj_url,
|
|
|
|
+ 'appad' => $add_ad_status['appad'],
|
|
|
|
+ 'appad_banner' => $add_ad_status['appad_banner'],
|
|
|
|
+ 'appad_url' => $add_ad_status['appad_url'],
|
|
|
|
+ 'outstanding_year_order' => $outstanding_year_order,
|
|
|
|
+ 'share_domain' => env('share_domain_url'),
|
|
|
|
+ 'share_switch' => 0,//无充值用户分享关闭
|
|
|
|
+ 'pdd_ad' => $pdd_ad,
|
|
|
|
+ 'special_pay_template' => $this->isMiWan(), //米玩站点特殊充值页面
|
|
|
|
+ 'crm' => $crm,
|
|
|
|
+ 'self_pa_ad_switch' => $self_pa_ad_switch,//自有平台广告开关
|
|
|
|
+ 'banners' => $banners,
|
|
|
|
+ 'guidepersonalaccount' => $this->guidePersonalAccount($user->openid),
|
|
|
|
+ 'cpc_channel' => $cpc_channel,
|
|
|
|
+ 'month_order_info' => $month_order_info,
|
|
|
|
+ 'xiyue_info' => $xiyue_info
|
|
]);
|
|
]);
|
|
if ($this->uid == env('SPECIAL_USER_LOG', 2)) {
|
|
if ($this->uid == env('SPECIAL_USER_LOG', 2)) {
|
|
myLog('special')->info('welcome --------------------------');
|
|
myLog('special')->info('welcome --------------------------');
|
|
@@ -333,21 +330,23 @@ class WelcomeController extends BaseController
|
|
return $channel_activities_flag;
|
|
return $channel_activities_flag;
|
|
}
|
|
}
|
|
|
|
|
|
- private function outstandingYearOrder(){
|
|
|
|
|
|
+ private function outstandingYearOrder()
|
|
|
|
+ {
|
|
$outstanding_year_order = false;
|
|
$outstanding_year_order = false;
|
|
- if(in_array($this->distribution_channel_id,explode(',',env('CAN_NOT_OUTSTANDING_YEAR_ORDER_SITE')))){
|
|
|
|
|
|
+ if (in_array($this->distribution_channel_id, explode(',', env('CAN_NOT_OUTSTANDING_YEAR_ORDER_SITE')))) {
|
|
return $outstanding_year_order;
|
|
return $outstanding_year_order;
|
|
}
|
|
}
|
|
//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){
|
|
|
|
- //$userDivisionProperty = UserDivisionPropertyService::getUserProperty($this->uid);
|
|
|
|
- //$userDivisionProperty = UserDivisionCpcPropertyService::getUserProperty($this->uid);
|
|
|
|
|
|
+ //if($this->uid%2 == 0){
|
|
|
|
+ //$userDivisionProperty = UserDivisionPropertyService::getUserProperty($this->uid);
|
|
|
|
+ //$userDivisionProperty = UserDivisionCpcPropertyService::getUserProperty($this->uid);
|
|
|
|
|
|
- $this->property == 'high' && $outstanding_year_order = true;
|
|
|
|
- //}
|
|
|
|
|
|
+ $this->property == 'high' && $outstanding_year_order = true;
|
|
|
|
+ //}
|
|
//}
|
|
//}
|
|
return $outstanding_year_order;
|
|
return $outstanding_year_order;
|
|
}
|
|
}
|
|
|
|
+
|
|
private function luckyUserForeverFree()
|
|
private function luckyUserForeverFree()
|
|
{
|
|
{
|
|
$lucky_user = 0;
|
|
$lucky_user = 0;
|
|
@@ -449,11 +448,11 @@ class WelcomeController extends BaseController
|
|
|
|
|
|
//自定义新用户活动
|
|
//自定义新用户活动
|
|
$show_custom_new_user_activity_channel = env('SHOW_CUSTOM_NEW_USER_ACTIVITY_CHANNEL', '');
|
|
$show_custom_new_user_activity_channel = env('SHOW_CUSTOM_NEW_USER_ACTIVITY_CHANNEL', '');
|
|
- if($show_custom_new_user_activity_channel && in_array($this->distribution_channel_id, explode(',', $show_custom_new_user_activity_channel ))){
|
|
|
|
- $custom_activity_page = ActivityService::getActiveCustomActivityByType($this->distribution_channel_id,'CUSTOM_NEW_USER');
|
|
|
|
- if($custom_activity_page){
|
|
|
|
- $charge_count = Order::where('uid',$this->uid)->where('status','PAID')->count();
|
|
|
|
- if($charge_count ==0 ){
|
|
|
|
|
|
+ if ($show_custom_new_user_activity_channel && in_array($this->distribution_channel_id, explode(',', $show_custom_new_user_activity_channel))) {
|
|
|
|
+ $custom_activity_page = ActivityService::getActiveCustomActivityByType($this->distribution_channel_id, 'CUSTOM_NEW_USER');
|
|
|
|
+ if ($custom_activity_page) {
|
|
|
|
+ $charge_count = Order::where('uid', $this->uid)->where('status', 'PAID')->count();
|
|
|
|
+ if ($charge_count == 0) {
|
|
$url = $h5_scheme . '://' . _domain() . $custom_activity_page->activity_page;
|
|
$url = $h5_scheme . '://' . _domain() . $custom_activity_page->activity_page;
|
|
$is_show_activity = 1;
|
|
$is_show_activity = 1;
|
|
$activity_title = '优惠活动';
|
|
$activity_title = '优惠活动';
|
|
@@ -490,8 +489,8 @@ class WelcomeController extends BaseController
|
|
if ($status) {
|
|
if ($status) {
|
|
$is_show_activity = 1;
|
|
$is_show_activity = 1;
|
|
$bottom_show_type = 2;
|
|
$bottom_show_type = 2;
|
|
- if($activity_setting['activity_id'] == env('OTHER_ACTIVITY_ID',0)){
|
|
|
|
- if(!in_array($this->distribution_channel_id, explode(',', env('OTHER_ACTIVITY_CHANNEL', '1')))){
|
|
|
|
|
|
+ if ($activity_setting['activity_id'] == env('OTHER_ACTIVITY_ID', 0)) {
|
|
|
|
+ if (!in_array($this->distribution_channel_id, explode(',', env('OTHER_ACTIVITY_CHANNEL', '1')))) {
|
|
$is_show_activity = 0;
|
|
$is_show_activity = 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -534,19 +533,19 @@ class WelcomeController extends BaseController
|
|
*/
|
|
*/
|
|
private function getSiteTitle(Request $request)
|
|
private function getSiteTitle(Request $request)
|
|
{
|
|
{
|
|
- if($this->distribution_channel_id == 6398) return '花溪亭苑';
|
|
|
|
- if($this->distribution_channel_id == 5216) return '花开文阁';
|
|
|
|
- if($this->distribution_channel_id == 6985) return '喜阅微书店';
|
|
|
|
|
|
+ if ($this->distribution_channel_id == 6398) return '花溪亭苑';
|
|
|
|
+ if ($this->distribution_channel_id == 5216) return '花开文阁';
|
|
|
|
+ if ($this->distribution_channel_id == 6985) return '喜阅微书店';
|
|
$title = "追书云";
|
|
$title = "追书云";
|
|
$get_force_subscribe_name = false;
|
|
$get_force_subscribe_name = false;
|
|
$subscribe = $request->cookie('force_subscribe_name');
|
|
$subscribe = $request->cookie('force_subscribe_name');
|
|
$appid = $request->get('appid');
|
|
$appid = $request->get('appid');
|
|
//用户进来携带的公众号信息
|
|
//用户进来携带的公众号信息
|
|
- if($appid){
|
|
|
|
- $force_subscribe_official = DB::table('official_accounts')->where('appid',$appid)->select('nickname')->first();
|
|
|
|
|
|
+ if ($appid) {
|
|
|
|
+ $force_subscribe_official = DB::table('official_accounts')->where('appid', $appid)->select('nickname')->first();
|
|
if ($force_subscribe_official) {
|
|
if ($force_subscribe_official) {
|
|
$title = $force_subscribe_official->nickname;
|
|
$title = $force_subscribe_official->nickname;
|
|
- if($title) return $title;
|
|
|
|
|
|
+ if ($title) return $title;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if ($subscribe) return $subscribe;
|
|
if ($subscribe) return $subscribe;
|
|
@@ -554,7 +553,7 @@ class WelcomeController extends BaseController
|
|
$force_subscribe = ForceSubscribeService::forceSubscribeUsersByUid(['uid' => $this->uid]);
|
|
$force_subscribe = ForceSubscribeService::forceSubscribeUsersByUid(['uid' => $this->uid]);
|
|
$this->force_subscribe_info = $force_subscribe;
|
|
$this->force_subscribe_info = $force_subscribe;
|
|
if ($force_subscribe) {
|
|
if ($force_subscribe) {
|
|
- $force_subscribe_official = DB::table('official_accounts')->where('appid',$force_subscribe->appid)->select('nickname')->first();
|
|
|
|
|
|
+ $force_subscribe_official = DB::table('official_accounts')->where('appid', $force_subscribe->appid)->select('nickname')->first();
|
|
if ($force_subscribe_official) {
|
|
if ($force_subscribe_official) {
|
|
$title = $force_subscribe_official->nickname;
|
|
$title = $force_subscribe_official->nickname;
|
|
$get_force_subscribe_name = true;
|
|
$get_force_subscribe_name = true;
|
|
@@ -573,51 +572,53 @@ class WelcomeController extends BaseController
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- private function appad(){
|
|
|
|
- if($this->force_subscribe_info){
|
|
|
|
|
|
+ private function appad()
|
|
|
|
+ {
|
|
|
|
+ if ($this->force_subscribe_info) {
|
|
$force_subscribe_info = $this->force_subscribe_info;
|
|
$force_subscribe_info = $this->force_subscribe_info;
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
$force_subscribe_info = $this->force_subscribe_info = ForceSubscribeService::forceSubscribeUsersByUid(['uid' => $this->uid]);
|
|
$force_subscribe_info = $this->force_subscribe_info = ForceSubscribeService::forceSubscribeUsersByUid(['uid' => $this->uid]);
|
|
//\Log::info(':'.($this->uid).'force_subs1:'.json_encode($force_subscribe_info));
|
|
//\Log::info(':'.($this->uid).'force_subs1:'.json_encode($force_subscribe_info));
|
|
}
|
|
}
|
|
- if(!$force_subscribe_info){
|
|
|
|
|
|
+ if (!$force_subscribe_info) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
$force_sub_user_by_openid = ForceSubscribeUserIService::getForceSubscribeByUidOpenid($this->uid);
|
|
$force_sub_user_by_openid = ForceSubscribeUserIService::getForceSubscribeByUidOpenid($this->uid);
|
|
- if($force_sub_user_by_openid){
|
|
|
|
|
|
+ if ($force_sub_user_by_openid) {
|
|
$force_subscribe_info = $force_sub_user_by_openid;
|
|
$force_subscribe_info = $force_sub_user_by_openid;
|
|
//\Log::info('force_subs:'.json_encode($force_subscribe_info));
|
|
//\Log::info('force_subs:'.json_encode($force_subscribe_info));
|
|
}
|
|
}
|
|
//\Log::info('force_subscribe_:'.json_encode($force_subscribe_info));
|
|
//\Log::info('force_subscribe_:'.json_encode($force_subscribe_info));
|
|
//\Log::info('distribution_channel_id:'.$this->distribution_channel_id);
|
|
//\Log::info('distribution_channel_id:'.$this->distribution_channel_id);
|
|
- if($force_subscribe_info->subscribe_time &&
|
|
|
|
- (time()-strtotime($force_subscribe_info->subscribe_time) >=3*86400)
|
|
|
|
|
|
+ if ($force_subscribe_info->subscribe_time &&
|
|
|
|
+ (time() - strtotime($force_subscribe_info->subscribe_time) >= 3 * 86400)
|
|
&& !OrderService::isPaidUserByOpenid($force_subscribe_info->openid) &&
|
|
&& !OrderService::isPaidUserByOpenid($force_subscribe_info->openid) &&
|
|
//!AdvertiseUserQueueService::getUserAdvertise($this->uid) &&
|
|
//!AdvertiseUserQueueService::getUserAdvertise($this->uid) &&
|
|
- in_array($this->distribution_channel_id,explode(',',env('SHARE_OPEN_SITE')))
|
|
|
|
- ){
|
|
|
|
|
|
+ in_array($this->distribution_channel_id, explode(',', env('SHARE_OPEN_SITE')))
|
|
|
|
+ ) {
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
//CPC广告的优化逻辑
|
|
//CPC广告的优化逻辑
|
|
- private function cpcAd($openid){
|
|
|
|
|
|
+ private function cpcAd($openid)
|
|
|
|
+ {
|
|
|
|
|
|
if (in_array($this->uid, explode(',', env('TEST_CPC_UID')))) {
|
|
if (in_array($this->uid, explode(',', env('TEST_CPC_UID')))) {
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
//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])){
|
|
- $cpc_status = Redis::hget('channel:setting:'.$this->distribution_channel_id,'cpc_status');
|
|
|
|
- if(is_null($cpc_status) || $cpc_status == 1){
|
|
|
|
|
|
+ $cpc_status = Redis::hget('channel:setting:' . $this->distribution_channel_id, 'cpc_status');
|
|
|
|
+ if (is_null($cpc_status) || $cpc_status == 1) {
|
|
$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';
|
|
//$property = UserDivisionCpcPropertyService::userLevel($openid);
|
|
//$property = UserDivisionCpcPropertyService::userLevel($openid);
|
|
/*if(UserService::isCpcUser($this->uid)){
|
|
/*if(UserService::isCpcUser($this->uid)){
|
|
Cookie::queue('cpc_ad_status', 'show');
|
|
Cookie::queue('cpc_ad_status', 'show');
|
|
return true;
|
|
return true;
|
|
}*/
|
|
}*/
|
|
- if($this->property == 'none'){
|
|
|
|
|
|
+ if ($this->property == 'none') {
|
|
Cookie::queue('cpc_ad_status', 'show');
|
|
Cookie::queue('cpc_ad_status', 'show');
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
@@ -626,11 +627,12 @@ class WelcomeController extends BaseController
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
- private function pddAd(){
|
|
|
|
- if($this->isPddAdSites()){
|
|
|
|
|
|
+ private function pddAd()
|
|
|
|
+ {
|
|
|
|
+ if ($this->isPddAdSites()) {
|
|
return [
|
|
return [
|
|
- 'banner'=>'https://cdn-novel.iycdm.com/h5/20190531/banner.jpg',
|
|
|
|
- 'url'=>'https://m.ycsd.cn/reader/9F69C5F384552E71/663249E009CA5AC0?u=13002705&isLogin=1'
|
|
|
|
|
|
+ 'banner' => 'https://cdn-novel.iycdm.com/h5/20190531/banner.jpg',
|
|
|
|
+ 'url' => 'https://m.ycsd.cn/reader/9F69C5F384552E71/663249E009CA5AC0?u=13002705&isLogin=1'
|
|
];
|
|
];
|
|
}
|
|
}
|
|
return '';
|
|
return '';
|
|
@@ -638,14 +640,15 @@ class WelcomeController extends BaseController
|
|
|
|
|
|
private function isPddAdSites()
|
|
private function isPddAdSites()
|
|
{
|
|
{
|
|
- return in_array($this->distribution_channel_id,[2,123,146,155,211,256,691,695,722,4025,4053,4174,4237,4241,4334,4364,4426,4427,4487,4593,4889,4891,5611]);
|
|
|
|
|
|
+ return in_array($this->distribution_channel_id, [2, 123, 146, 155, 211, 256, 691, 695, 722, 4025, 4053, 4174, 4237, 4241, 4334, 4364, 4426, 4427, 4487, 4593, 4889, 4891, 5611]);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- private function isMiWan(){
|
|
|
|
|
|
+ private function isMiWan()
|
|
|
|
+ {
|
|
$miwan_channel_ids = redisEnv('MIWAN_CHANNEL_ID');
|
|
$miwan_channel_ids = redisEnv('MIWAN_CHANNEL_ID');
|
|
- if(!$miwan_channel_ids) return false;
|
|
|
|
- return in_array($this->distribution_channel_id,explode(',',$miwan_channel_ids));
|
|
|
|
|
|
+ if (!$miwan_channel_ids) return false;
|
|
|
|
+ return in_array($this->distribution_channel_id, explode(',', $miwan_channel_ids));
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -657,7 +660,7 @@ class WelcomeController extends BaseController
|
|
if ($setting && $setting->customer_img_url) {
|
|
if ($setting && $setting->customer_img_url) {
|
|
$customer_service = $setting->customer_img_url;
|
|
$customer_service = $setting->customer_img_url;
|
|
} else {
|
|
} else {
|
|
- $customer_service = env('KE_FU_QRCODE','https://cdn-novel.iycdm.com/static/img/kefu20190319.jpg');
|
|
|
|
|
|
+ $customer_service = env('KE_FU_QRCODE', 'https://cdn-novel.iycdm.com/static/img/kefu20190319.jpg');
|
|
//$customer_service = 'https://cdn-novel.iycdm.com/static/img/kefu20190330.jpg';
|
|
//$customer_service = 'https://cdn-novel.iycdm.com/static/img/kefu20190330.jpg';
|
|
}
|
|
}
|
|
return $customer_service;
|
|
return $customer_service;
|
|
@@ -1058,15 +1061,15 @@ class WelcomeController extends BaseController
|
|
//$order = Order::where('uid',$this->uid)->where('status','PAID')->where('activity_id',$activity_info->id)->count();
|
|
//$order = Order::where('uid',$this->uid)->where('status','PAID')->where('activity_id',$activity_info->id)->count();
|
|
//渠道不符合
|
|
//渠道不符合
|
|
if ($activity_info->distribution_channel_id != $this->distribution_channel_id) {
|
|
if ($activity_info->distribution_channel_id != $this->distribution_channel_id) {
|
|
- return view('pay.order.longactivitysixtyeight', ['url' => '###', 'img'=>$img,'code' => -1, 'start_time' => date('Y-m-d', time() - 86400 * 2), 'end_time' => date('Y-m-d', time() - 86400)]);
|
|
|
|
|
|
+ return view('pay.order.longactivitysixtyeight', ['url' => '###', 'img' => $img, 'code' => -1, 'start_time' => date('Y-m-d', time() - 86400 * 2), 'end_time' => date('Y-m-d', time() - 86400)]);
|
|
}
|
|
}
|
|
//活动未开始
|
|
//活动未开始
|
|
if (time() < strtotime($activity_info->start_time)) {
|
|
if (time() < strtotime($activity_info->start_time)) {
|
|
- return view('pay.order.longactivitysixtyeight', ['url' => '###', 'img'=>$img, 'code' => -3, 'start_time' => date('Y-m-d', strtotime($activity_info->start_time)), 'end_time' => date('Y-m-d', strtotime($activity_info->end_time) - 100)]);
|
|
|
|
|
|
+ return view('pay.order.longactivitysixtyeight', ['url' => '###', 'img' => $img, 'code' => -3, 'start_time' => date('Y-m-d', strtotime($activity_info->start_time)), 'end_time' => date('Y-m-d', strtotime($activity_info->end_time) - 100)]);
|
|
}
|
|
}
|
|
//活动结束
|
|
//活动结束
|
|
if (time() > strtotime($activity_info->end_time)) {
|
|
if (time() > strtotime($activity_info->end_time)) {
|
|
- return view('pay.order.longactivitysixtyeight', ['url' => '###', 'img'=>$img, 'code' => -1, 'start_time' => date('Y-m-d', strtotime($activity_info->start_time)), 'end_time' => date('Y-m-d', strtotime($activity_info->end_time) - 100)]);
|
|
|
|
|
|
+ return view('pay.order.longactivitysixtyeight', ['url' => '###', 'img' => $img, 'code' => -1, 'start_time' => date('Y-m-d', strtotime($activity_info->start_time)), 'end_time' => date('Y-m-d', strtotime($activity_info->end_time) - 100)]);
|
|
}
|
|
}
|
|
|
|
|
|
if (time() > strtotime($activity_info->start_time) && time() < strtotime($activity_info->end_time)) {
|
|
if (time() > strtotime($activity_info->start_time) && time() < strtotime($activity_info->end_time)) {
|
|
@@ -1080,10 +1083,10 @@ class WelcomeController extends BaseController
|
|
'pay_redirect_url' => env('H5_SCHEME', 'https') . '://site' . $encode_distribution_channel_id . '.' . env('CUSTOM_HOST') . '.com/person'
|
|
'pay_redirect_url' => env('H5_SCHEME', 'https') . '://site' . $encode_distribution_channel_id . '.' . env('CUSTOM_HOST') . '.com/person'
|
|
];
|
|
];
|
|
$url = env('CREATE_PAY_URL') . '?' . http_build_query($param);
|
|
$url = env('CREATE_PAY_URL') . '?' . http_build_query($param);
|
|
- return view('pay.order.longactivitysixtyeight', ['url' => $url, 'img'=>$img, 'code' => 0, 'start_time' => date('Y-m-d', strtotime($activity_info->start_time)), 'end_time' => date('Y-m-d', strtotime($activity_info->end_time) - 100)]);
|
|
|
|
|
|
+ return view('pay.order.longactivitysixtyeight', ['url' => $url, 'img' => $img, 'code' => 0, 'start_time' => date('Y-m-d', strtotime($activity_info->start_time)), 'end_time' => date('Y-m-d', strtotime($activity_info->end_time) - 100)]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return view('pay.order.longactivitysixtyeight', ['url' => '###', 'img'=>$img, 'code' => -1, 'start_time' => date('Y-m-d', time() - 86400 * 2), 'end_time' => date('Y-m-d', time() - 86400)]);
|
|
|
|
|
|
+ return view('pay.order.longactivitysixtyeight', ['url' => '###', 'img' => $img, 'code' => -1, 'start_time' => date('Y-m-d', time() - 86400 * 2), 'end_time' => date('Y-m-d', time() - 86400)]);
|
|
}
|
|
}
|
|
|
|
|
|
public function channelActivityFortyEight(Request $request)
|
|
public function channelActivityFortyEight(Request $request)
|
|
@@ -1103,15 +1106,15 @@ class WelcomeController extends BaseController
|
|
//$order = Order::where('uid',$this->uid)->where('status','PAID')->where('activity_id',$activity_info->id)->count();
|
|
//$order = Order::where('uid',$this->uid)->where('status','PAID')->where('activity_id',$activity_info->id)->count();
|
|
//渠道不符合
|
|
//渠道不符合
|
|
if ($activity_info->distribution_channel_id != $this->distribution_channel_id) {
|
|
if ($activity_info->distribution_channel_id != $this->distribution_channel_id) {
|
|
- return view('pay.order.longactivitysixtyeight', ['url' => '###', 'img'=>$img,'code' => -1, 'start_time' => date('Y-m-d', time() - 86400 * 2), 'end_time' => date('Y-m-d', time() - 86400)]);
|
|
|
|
|
|
+ return view('pay.order.longactivitysixtyeight', ['url' => '###', 'img' => $img, 'code' => -1, 'start_time' => date('Y-m-d', time() - 86400 * 2), 'end_time' => date('Y-m-d', time() - 86400)]);
|
|
}
|
|
}
|
|
//活动未开始
|
|
//活动未开始
|
|
if (time() < strtotime($activity_info->start_time)) {
|
|
if (time() < strtotime($activity_info->start_time)) {
|
|
- return view('pay.order.longactivitysixtyeight', ['url' => '###', 'img'=>$img, 'code' => -3, 'start_time' => date('Y-m-d', strtotime($activity_info->start_time)), 'end_time' => date('Y-m-d', strtotime($activity_info->end_time) - 100)]);
|
|
|
|
|
|
+ return view('pay.order.longactivitysixtyeight', ['url' => '###', 'img' => $img, 'code' => -3, 'start_time' => date('Y-m-d', strtotime($activity_info->start_time)), 'end_time' => date('Y-m-d', strtotime($activity_info->end_time) - 100)]);
|
|
}
|
|
}
|
|
//活动结束
|
|
//活动结束
|
|
if (time() > strtotime($activity_info->end_time)) {
|
|
if (time() > strtotime($activity_info->end_time)) {
|
|
- return view('pay.order.longactivitysixtyeight', ['url' => '###', 'img'=>$img, 'code' => -1, 'start_time' => date('Y-m-d', strtotime($activity_info->start_time)), 'end_time' => date('Y-m-d', strtotime($activity_info->end_time) - 100)]);
|
|
|
|
|
|
+ return view('pay.order.longactivitysixtyeight', ['url' => '###', 'img' => $img, 'code' => -1, 'start_time' => date('Y-m-d', strtotime($activity_info->start_time)), 'end_time' => date('Y-m-d', strtotime($activity_info->end_time) - 100)]);
|
|
}
|
|
}
|
|
|
|
|
|
if (time() > strtotime($activity_info->start_time) && time() < strtotime($activity_info->end_time)) {
|
|
if (time() > strtotime($activity_info->start_time) && time() < strtotime($activity_info->end_time)) {
|
|
@@ -1125,10 +1128,10 @@ class WelcomeController extends BaseController
|
|
'pay_redirect_url' => env('H5_SCHEME', 'https') . '://site' . $encode_distribution_channel_id . '.' . env('CUSTOM_HOST') . '.com/person'
|
|
'pay_redirect_url' => env('H5_SCHEME', 'https') . '://site' . $encode_distribution_channel_id . '.' . env('CUSTOM_HOST') . '.com/person'
|
|
];
|
|
];
|
|
$url = env('CREATE_PAY_URL') . '?' . http_build_query($param);
|
|
$url = env('CREATE_PAY_URL') . '?' . http_build_query($param);
|
|
- return view('pay.order.longactivitysixtyeight', ['url' => $url, 'img'=>$img, 'code' => 0, 'start_time' => date('Y-m-d', strtotime($activity_info->start_time)), 'end_time' => date('Y-m-d', strtotime($activity_info->end_time) - 100)]);
|
|
|
|
|
|
+ return view('pay.order.longactivitysixtyeight', ['url' => $url, 'img' => $img, 'code' => 0, 'start_time' => date('Y-m-d', strtotime($activity_info->start_time)), 'end_time' => date('Y-m-d', strtotime($activity_info->end_time) - 100)]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return view('pay.order.longactivitysixtyeight', ['url' => '###', 'img'=>$img, 'code' => -1, 'start_time' => date('Y-m-d', time() - 86400 * 2), 'end_time' => date('Y-m-d', time() - 86400)]);
|
|
|
|
|
|
+ return view('pay.order.longactivitysixtyeight', ['url' => '###', 'img' => $img, 'code' => -1, 'start_time' => date('Y-m-d', time() - 86400 * 2), 'end_time' => date('Y-m-d', time() - 86400)]);
|
|
}
|
|
}
|
|
|
|
|
|
public function channelNewUserActivity(Request $request)
|
|
public function channelNewUserActivity(Request $request)
|
|
@@ -1141,7 +1144,7 @@ class WelcomeController extends BaseController
|
|
$uv_key_format = 'activity:%s:distribution_channel_id:%s:date:%s:uv';
|
|
$uv_key_format = 'activity:%s:distribution_channel_id:%s:date:%s:uv';
|
|
$pv_key_format = 'activity:%s:distribution_channel_id:%s:pv';
|
|
$pv_key_format = 'activity:%s:distribution_channel_id:%s:pv';
|
|
|
|
|
|
- if ($activity_info && $activity_info->product_id){
|
|
|
|
|
|
+ if ($activity_info && $activity_info->product_id) {
|
|
$activity_id = $activity_info->id;
|
|
$activity_id = $activity_info->id;
|
|
$uv_key = sprintf($uv_key_format, $activity_id, $this->distribution_channel_id, date('Y-m-d'));
|
|
$uv_key = sprintf($uv_key_format, $activity_id, $this->distribution_channel_id, date('Y-m-d'));
|
|
$pv_key = sprintf($pv_key_format, $activity_id, $this->distribution_channel_id);
|
|
$pv_key = sprintf($pv_key_format, $activity_id, $this->distribution_channel_id);
|
|
@@ -1149,18 +1152,18 @@ class WelcomeController extends BaseController
|
|
Redis::hincrby($pv_key, date('Y-m-d'), 1);
|
|
Redis::hincrby($pv_key, date('Y-m-d'), 1);
|
|
//活动未开始
|
|
//活动未开始
|
|
if (time() < strtotime($activity_info->start_time)) {
|
|
if (time() < strtotime($activity_info->start_time)) {
|
|
- return view('pay.order.newUserActivity', ['url' => '###', 'code' => -3, 'start_time' => substr($activity_info->start_time,0,10), 'end_time' => substr($activity_info->end_time,0,10)]);
|
|
|
|
|
|
+ return view('pay.order.newUserActivity', ['url' => '###', 'code' => -3, 'start_time' => substr($activity_info->start_time, 0, 10), 'end_time' => substr($activity_info->end_time, 0, 10)]);
|
|
}
|
|
}
|
|
|
|
|
|
//活动结束
|
|
//活动结束
|
|
if (time() > strtotime($activity_info->end_time)) {
|
|
if (time() > strtotime($activity_info->end_time)) {
|
|
- return view('pay.order.newUserActivity', ['url' => '###', 'code' => -2, 'start_time' => substr($activity_info->start_time,0,10), 'end_time' => substr($activity_info->end_time,0,10)]);
|
|
|
|
|
|
+ return view('pay.order.newUserActivity', ['url' => '###', 'code' => -2, 'start_time' => substr($activity_info->start_time, 0, 10), 'end_time' => substr($activity_info->end_time, 0, 10)]);
|
|
}
|
|
}
|
|
|
|
|
|
- $charge_count = Order::where('uid',$this->uid)->where('status','PAID')->count();
|
|
|
|
- if($charge_count >0){
|
|
|
|
|
|
+ $charge_count = Order::where('uid', $this->uid)->where('status', 'PAID')->count();
|
|
|
|
+ if ($charge_count > 0) {
|
|
//不是新用户
|
|
//不是新用户
|
|
- return view('pay.order.newUserActivity', ['url' => '###', 'code' => -1, 'start_time' => substr($activity_info->start_time,0,10), 'end_time' => substr($activity_info->end_time,0,10)]);
|
|
|
|
|
|
+ return view('pay.order.newUserActivity', ['url' => '###', 'code' => -1, 'start_time' => substr($activity_info->start_time, 0, 10), 'end_time' => substr($activity_info->end_time, 0, 10)]);
|
|
}
|
|
}
|
|
|
|
|
|
$param = [
|
|
$param = [
|
|
@@ -1172,9 +1175,9 @@ class WelcomeController extends BaseController
|
|
'pay_redirect_url' => env('H5_SCHEME', 'https') . '://site' . $encode_distribution_channel_id . '.' . env('CUSTOM_HOST') . '.com/person'
|
|
'pay_redirect_url' => env('H5_SCHEME', 'https') . '://site' . $encode_distribution_channel_id . '.' . env('CUSTOM_HOST') . '.com/person'
|
|
];
|
|
];
|
|
$url = env('CREATE_PAY_URL') . '?' . http_build_query($param);
|
|
$url = env('CREATE_PAY_URL') . '?' . http_build_query($param);
|
|
- return view('pay.order.newUserActivity', ['url' => $url, 'code' => 0, 'start_time' => substr($activity_info->start_time,0,10), 'end_time' => substr($activity_info->end_time,0,10)]);
|
|
|
|
|
|
+ return view('pay.order.newUserActivity', ['url' => $url, 'code' => 0, 'start_time' => substr($activity_info->start_time, 0, 10), 'end_time' => substr($activity_info->end_time, 0, 10)]);
|
|
}
|
|
}
|
|
- return view('pay.order.newUserActivity', ['url' => '###', 'code' => -2, 'start_time' => date('Y-m-d',time()-86400*2), 'end_time' => date('Y-m-d',time()-86400)]);
|
|
|
|
|
|
+ return view('pay.order.newUserActivity', ['url' => '###', 'code' => -2, 'start_time' => date('Y-m-d', time() - 86400 * 2), 'end_time' => date('Y-m-d', time() - 86400)]);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -1520,7 +1523,7 @@ class WelcomeController extends BaseController
|
|
return $url_info;
|
|
return $url_info;
|
|
}
|
|
}
|
|
foreach ($product as $v) {
|
|
foreach ($product as $v) {
|
|
- if(in_array($this->distribution_channel_id,[6917,6918,6939]) && $v->type == 'YEAR_ORDER'){
|
|
|
|
|
|
+ if (in_array($this->distribution_channel_id, [6917, 6918, 6939]) && $v->type == 'YEAR_ORDER') {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
if ($is_access) {
|
|
if ($is_access) {
|
|
@@ -2098,7 +2101,7 @@ class WelcomeController extends BaseController
|
|
if ($least_charge_amount && $least_charge_amount >= 30) {
|
|
if ($least_charge_amount && $least_charge_amount >= 30) {
|
|
$img = 'https://cdn-novel.iycdm.com/h5/activity-2019-03-20/bg50.jpg';
|
|
$img = 'https://cdn-novel.iycdm.com/h5/activity-2019-03-20/bg50.jpg';
|
|
$product_ids = 4806;
|
|
$product_ids = 4806;
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
$img = 'https://cdn-novel.iycdm.com/h5/activity-2019-03-20/bg23.jpg';
|
|
$img = 'https://cdn-novel.iycdm.com/h5/activity-2019-03-20/bg23.jpg';
|
|
$product_ids = 4805;
|
|
$product_ids = 4805;
|
|
}
|
|
}
|
|
@@ -2112,26 +2115,27 @@ class WelcomeController extends BaseController
|
|
return view('pay.order.vernalEquinoxActivity', ['url' => ['javascript:void(0)', 'javascript:void(0)'], 'code' => -2, 'type' => $type, 'img' => $img]);
|
|
return view('pay.order.vernalEquinoxActivity', ['url' => ['javascript:void(0)', 'javascript:void(0)'], 'code' => -2, 'type' => $type, 'img' => $img]);
|
|
}
|
|
}
|
|
|
|
|
|
- $param = [
|
|
|
|
- 'uid' => $this->uid,
|
|
|
|
- 'distribution_channel_id' => $this->distribution_channel_id,
|
|
|
|
- 'product_id' => $product_ids,
|
|
|
|
- 'activity_id' => $activity_info->id,
|
|
|
|
- 'fromtype' => $from,
|
|
|
|
- 'pay_redirect_url' => $redirect_url,
|
|
|
|
- 'limit' => 100,
|
|
|
|
- ];
|
|
|
|
- $url = env('CREATE_PAY_URL') . '?' . http_build_query($param);
|
|
|
|
|
|
+ $param = [
|
|
|
|
+ 'uid' => $this->uid,
|
|
|
|
+ 'distribution_channel_id' => $this->distribution_channel_id,
|
|
|
|
+ 'product_id' => $product_ids,
|
|
|
|
+ 'activity_id' => $activity_info->id,
|
|
|
|
+ 'fromtype' => $from,
|
|
|
|
+ 'pay_redirect_url' => $redirect_url,
|
|
|
|
+ 'limit' => 100,
|
|
|
|
+ ];
|
|
|
|
+ $url = env('CREATE_PAY_URL') . '?' . http_build_query($param);
|
|
return view('pay.order.vernalEquinoxActivity', ['url' => $url, 'code' => 0, 'type' => $type, 'img' => $img]);
|
|
return view('pay.order.vernalEquinoxActivity', ['url' => $url, 'code' => 0, 'type' => $type, 'img' => $img]);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- private function userPproperty(){
|
|
|
|
- if($this->property == 'undefined'){
|
|
|
|
- if($this->user && time()-strtotime($this->user->created_at) >= 3*66400){
|
|
|
|
|
|
+ private function userPproperty()
|
|
|
|
+ {
|
|
|
|
+ if ($this->property == 'undefined') {
|
|
|
|
+ if ($this->user && time() - strtotime($this->user->created_at) >= 3 * 66400) {
|
|
$info = UserDivisionCpcPropertyService::calculateUserPropertyV2($this->uid);
|
|
$info = UserDivisionCpcPropertyService::calculateUserPropertyV2($this->uid);
|
|
- if($info && $info['property'] != 'undefined'){
|
|
|
|
- UserDivisionCpcPropertyService::updateV2($info['openid'],$info['property']);
|
|
|
|
|
|
+ if ($info && $info['property'] != 'undefined') {
|
|
|
|
+ UserDivisionCpcPropertyService::updateV2($info['openid'], $info['property']);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -2153,48 +2157,49 @@ class WelcomeController extends BaseController
|
|
}*/
|
|
}*/
|
|
}
|
|
}
|
|
|
|
|
|
- private function guidePersonalAccount($openid){
|
|
|
|
|
|
+ private function guidePersonalAccount($openid)
|
|
|
|
+ {
|
|
//weidian
|
|
//weidian
|
|
- $other_crm_config = Redis::hmget('channel:setting:'.$this->distribution_channel_id,['crm_status','crm_link']);
|
|
|
|
- $crm_config = redisEnvMulti('GUIDE_PERSONAL_ACCOUNT_SITES','ACTIVE_GUIDE_PERSONAL_ACCOUNT_OURS_QRCODE','OUT_ACTIVE_GUIDE_PERSONAL_ACCOUNT_OURS_QRCODE');
|
|
|
|
|
|
+ $other_crm_config = Redis::hmget('channel:setting:' . $this->distribution_channel_id, ['crm_status', 'crm_link']);
|
|
|
|
+ $crm_config = redisEnvMulti('GUIDE_PERSONAL_ACCOUNT_SITES', 'ACTIVE_GUIDE_PERSONAL_ACCOUNT_OURS_QRCODE', 'OUT_ACTIVE_GUIDE_PERSONAL_ACCOUNT_OURS_QRCODE');
|
|
|
|
|
|
- $out_status = Redis::SISMEMBER('crm:out_channel_sites',$this->distribution_channel_id);
|
|
|
|
|
|
+ $out_status = Redis::SISMEMBER('crm:out_channel_sites', $this->distribution_channel_id);
|
|
|
|
|
|
- if(empty($other_crm_config[0]) && empty($other_crm_config[1]) && empty($crm_config[0]) && empty($crm_config[1]) && empty($out_status)){
|
|
|
|
|
|
+ if (empty($other_crm_config[0]) && empty($other_crm_config[1]) && empty($crm_config[0]) && empty($crm_config[1]) && empty($out_status)) {
|
|
return '';
|
|
return '';
|
|
}
|
|
}
|
|
|
|
|
|
//Log::info('guidePersonalAccount1111111111111111111111');
|
|
//Log::info('guidePersonalAccount1111111111111111111111');
|
|
$get_info = UserBindHkWelfareService::isHasGet($this->uid);
|
|
$get_info = UserBindHkWelfareService::isHasGet($this->uid);
|
|
- if($get_info) return '';
|
|
|
|
|
|
+ if ($get_info) return '';
|
|
//Log::info('guidePersonalAccount2222222222222222222222');
|
|
//Log::info('guidePersonalAccount2222222222222222222222');
|
|
$charge = false;
|
|
$charge = false;
|
|
- if(in_array($this->property, ['medium','high'])){
|
|
|
|
|
|
+ if (in_array($this->property, ['medium', 'high'])) {
|
|
$charge = true;
|
|
$charge = true;
|
|
- }else{
|
|
|
|
- if($this->property == 'undefined' && OrderService::getChargeNum($this->uid) >=10){
|
|
|
|
- $charge = true;
|
|
|
|
- }
|
|
|
|
|
|
+ } else {
|
|
|
|
+ if ($this->property == 'undefined' && OrderService::getChargeNum($this->uid) >= 10) {
|
|
|
|
+ $charge = true;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
- if($this->distribution_channel_id == 6687){
|
|
|
|
|
|
+ if ($this->distribution_channel_id == 6687) {
|
|
$charge = true;
|
|
$charge = true;
|
|
}
|
|
}
|
|
|
|
|
|
- if(!$charge) return '';
|
|
|
|
|
|
+ if (!$charge) return '';
|
|
//其他渠道自己导粉
|
|
//其他渠道自己导粉
|
|
- if($other_crm_config[0] && $other_crm_config[1]){
|
|
|
|
- if($charge)
|
|
|
|
- return ['title'=>'点击领取200书币>>','link'=>$other_crm_config[1]];
|
|
|
|
|
|
+ if ($other_crm_config[0] && $other_crm_config[1]) {
|
|
|
|
+ if ($charge)
|
|
|
|
+ return ['title' => '点击领取200书币>>', 'link' => $other_crm_config[1]];
|
|
return '';
|
|
return '';
|
|
}
|
|
}
|
|
//站外导粉
|
|
//站外导粉
|
|
- if($out_status){
|
|
|
|
- if(!$charge) return '';
|
|
|
|
- if(empty($crm_config[2])){
|
|
|
|
|
|
+ if ($out_status) {
|
|
|
|
+ if (!$charge) return '';
|
|
|
|
+ if (empty($crm_config[2])) {
|
|
return '';
|
|
return '';
|
|
}
|
|
}
|
|
- $filter_city = ['长沙','深圳','杭州'];
|
|
|
|
|
|
+ $filter_city = ['长沙', '深圳', '杭州'];
|
|
$ip2region = new Ip2Region();
|
|
$ip2region = new Ip2Region();
|
|
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR']) {
|
|
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR']) {
|
|
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
|
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
|
@@ -2202,53 +2207,56 @@ class WelcomeController extends BaseController
|
|
$ip = get_client_ip();
|
|
$ip = get_client_ip();
|
|
}
|
|
}
|
|
$info = [];
|
|
$info = [];
|
|
- try{
|
|
|
|
|
|
+ try {
|
|
$info = $ip2region->btreeSearch($ip);
|
|
$info = $ip2region->btreeSearch($ip);
|
|
- }catch (\Exception $e){}
|
|
|
|
|
|
+ } catch (\Exception $e) {
|
|
|
|
+ }
|
|
|
|
|
|
- if(!$info || !isset($info['region'])) return '';
|
|
|
|
- $region = explode('|',$info['region']);
|
|
|
|
- $city = isset($region[3])? $region[3]:'';
|
|
|
|
- if(in_array($city,$filter_city)){
|
|
|
|
|
|
+ if (!$info || !isset($info['region'])) return '';
|
|
|
|
+ $region = explode('|', $info['region']);
|
|
|
|
+ $city = isset($region[3]) ? $region[3] : '';
|
|
|
|
+ if (in_array($city, $filter_city)) {
|
|
return '';
|
|
return '';
|
|
}
|
|
}
|
|
$count = ChapterOrderService::getRecentChapterOrderCount($this->uid);
|
|
$count = ChapterOrderService::getRecentChapterOrderCount($this->uid);
|
|
- if ($count<50) {
|
|
|
|
|
|
+ if ($count < 50) {
|
|
return '';
|
|
return '';
|
|
}
|
|
}
|
|
Cookie::queue('is_force_out_guide', 1);
|
|
Cookie::queue('is_force_out_guide', 1);
|
|
//Redis::hset('crm:out_guide_exposure_user',$openid,$this->uid);
|
|
//Redis::hset('crm:out_guide_exposure_user',$openid,$this->uid);
|
|
- return ['title'=>'您有500书币待领取>>','link'=>'/guidestrem?uid='.$this->uid.'&fee=500'];
|
|
|
|
|
|
+ return ['title' => '您有500书币待领取>>', 'link' => '/guidestrem?uid=' . $this->uid . '&fee=500'];
|
|
|
|
|
|
}
|
|
}
|
|
//Log::info('guidePersonalAccount33333333333333333');
|
|
//Log::info('guidePersonalAccount33333333333333333');
|
|
- if(empty($crm_config[0]) || empty($crm_config[1])) return '';
|
|
|
|
|
|
+ if (empty($crm_config[0]) || empty($crm_config[1])) return '';
|
|
//Log::info('guidePersonalAccount4444444444444444');
|
|
//Log::info('guidePersonalAccount4444444444444444');
|
|
- if(!in_array($this->distribution_channel_id,explode(',',$crm_config[0]))){
|
|
|
|
|
|
+ if (!in_array($this->distribution_channel_id, explode(',', $crm_config[0]))) {
|
|
return '';
|
|
return '';
|
|
}
|
|
}
|
|
//Log::info('guidePersonalAccount555555555555555');
|
|
//Log::info('guidePersonalAccount555555555555555');
|
|
- if($charge){
|
|
|
|
- return ['title'=>'您有500书币待领取>>','link'=>'/guidestrem?uid='.$this->uid.'&fee=500'];
|
|
|
|
|
|
+ if ($charge) {
|
|
|
|
+ return ['title' => '您有500书币待领取>>', 'link' => '/guidestrem?uid=' . $this->uid . '&fee=500'];
|
|
}
|
|
}
|
|
return '';
|
|
return '';
|
|
}
|
|
}
|
|
|
|
|
|
- private function setIsPaid(){
|
|
|
|
- $charge = Order::where('uid',$this->uid)
|
|
|
|
- ->where('status','PAID')
|
|
|
|
|
|
+ private function setIsPaid()
|
|
|
|
+ {
|
|
|
|
+ $charge = Order::where('uid', $this->uid)
|
|
|
|
+ ->where('status', 'PAID')
|
|
->select('id')
|
|
->select('id')
|
|
->first();
|
|
->first();
|
|
- if($charge){
|
|
|
|
|
|
+ if ($charge) {
|
|
Cookie::queue('is_paid', 1);
|
|
Cookie::queue('is_paid', 1);
|
|
$this->is_paid = true;
|
|
$this->is_paid = true;
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
Cookie::queue('is_paid', 0);
|
|
Cookie::queue('is_paid', 0);
|
|
$this->is_paid = false;
|
|
$this->is_paid = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private function setProperty($openid){
|
|
|
|
|
|
+ private function setProperty($openid)
|
|
|
|
+ {
|
|
$property = UserDivisionCpcPropertyService::userLevelV2($openid);
|
|
$property = UserDivisionCpcPropertyService::userLevelV2($openid);
|
|
$this->property = $property;
|
|
$this->property = $property;
|
|
}
|
|
}
|
|
@@ -2257,70 +2265,78 @@ class WelcomeController extends BaseController
|
|
private function recordUA($ua)
|
|
private function recordUA($ua)
|
|
{
|
|
{
|
|
$is_ua_open = RedisEnv('ua_open');
|
|
$is_ua_open = RedisEnv('ua_open');
|
|
- if($is_ua_open && $ua)//开启
|
|
|
|
|
|
+ if ($is_ua_open && $ua)//开启
|
|
{
|
|
{
|
|
//判断是否已经统计
|
|
//判断是否已经统计
|
|
- $has_got = Redis::hget('book_read:'.$this->uid,'ua');
|
|
|
|
- if(!$has_got)
|
|
|
|
- {
|
|
|
|
- try{
|
|
|
|
- Redis::hset('book_read:'.$this->uid,'ua',1);
|
|
|
|
- UserService::recordUA($ua,$this->uid);
|
|
|
|
- }catch (\Exception $e) {
|
|
|
|
|
|
+ $has_got = Redis::hget('book_read:' . $this->uid, 'ua');
|
|
|
|
+ if (!$has_got) {
|
|
|
|
+ try {
|
|
|
|
+ Redis::hset('book_read:' . $this->uid, 'ua', 1);
|
|
|
|
+ UserService::recordUA($ua, $this->uid);
|
|
|
|
+ } catch (\Exception $e) {
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- private function monthOrderInfo($openid){
|
|
|
|
|
|
+
|
|
|
|
+ private function monthOrderInfo($openid)
|
|
|
|
+ {
|
|
$property = $this->property;
|
|
$property = $this->property;
|
|
if (!$property) return '';
|
|
if (!$property) return '';
|
|
- if(in_array($this->distribution_channel_id, explode(',', redisEnv('OPEN_ORDER_INNER_SITES')))){
|
|
|
|
- $info = DataAnalysisSelectUserService::getByUidAndType($this->uid,'MONTH_V2');
|
|
|
|
- if($info){
|
|
|
|
- if($info->attach == 'show'){
|
|
|
|
|
|
+ if (in_array($this->distribution_channel_id, explode(',', redisEnv('OPEN_ORDER_INNER_SITES')))) {
|
|
|
|
+ $info = DataAnalysisSelectUserService::getByUidAndType($this->uid, 'MONTH_V2');
|
|
|
|
+ if ($info) {
|
|
|
|
+ if ($info->attach == 'show') {
|
|
return [
|
|
return [
|
|
- 'price'=>'30元',
|
|
|
|
|
|
+ 'price' => '30元',
|
|
'text' => '30元包月 全站万本精彩小说免费看',
|
|
'text' => '30元包月 全站万本精彩小说免费看',
|
|
- 'link'=> generateMonthOrderUrl($this->uid)
|
|
|
|
- //'link'=> '/rmonthpay'
|
|
|
|
|
|
+ 'link' => generateMonthOrderUrl($this->uid)
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
|
|
+ if ($info->attach == 'week-show') {
|
|
|
|
+ return [
|
|
|
|
+ 'price' => '7元',
|
|
|
|
+ 'text' => '7元包周 全站万本精彩小说免费看',
|
|
|
|
+ 'link' => generateMonthOrderUrlV2($this->uid, env('MONTH_WEEK_ORDER_PLAN_ID'), _getIp())
|
|
];
|
|
];
|
|
}
|
|
}
|
|
return '';
|
|
return '';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (in_array($this->distribution_channel_id, explode(',', redisEnv('OPEN_ORDER_INNER_SITES')))
|
|
if (in_array($this->distribution_channel_id, explode(',', redisEnv('OPEN_ORDER_INNER_SITES')))
|
|
- && in_array($property, ['none','low', 'medium'])
|
|
|
|
|
|
+ && in_array($property, ['none', 'low', 'medium'])
|
|
) {
|
|
) {
|
|
- if(!UserMonthService::isSignMonth($openid)){
|
|
|
|
|
|
+ if (!UserMonthService::isSignMonth($openid)) {
|
|
$start_time = redisEnv('MONTH_TEMPLATE_COMPARE_START_TIME', 0);
|
|
$start_time = redisEnv('MONTH_TEMPLATE_COMPARE_START_TIME', 0);
|
|
- if($start_time){
|
|
|
|
- if (strtotime($this->user->created_at) < $start_time) {
|
|
|
|
- return [
|
|
|
|
- 'price'=>'30元',
|
|
|
|
|
|
+ if (!$start_time || (strtotime($this->user->created_at) < $start_time)) {
|
|
|
|
+ if ($property == 'low') {
|
|
|
|
+ return [
|
|
|
|
+ 'price' => '7元',
|
|
|
|
+ 'text' => '7元包周 全站万本精彩小说免费看',
|
|
|
|
+ 'link' => generateMonthOrderUrlV2($this->uid, env('MONTH_WEEK_ORDER_PLAN_ID'), _getIp())
|
|
|
|
+ ];
|
|
|
|
+ } else {
|
|
|
|
+ return [
|
|
|
|
+ 'price' => '30元',
|
|
'text' => '30元包月 全站万本精彩小说免费看',
|
|
'text' => '30元包月 全站万本精彩小说免费看',
|
|
- 'link'=> generateMonthOrderUrl($this->uid)
|
|
|
|
- //'link'=> '/rmonthpay'
|
|
|
|
|
|
+ 'link' => generateMonthOrderUrl($this->uid)
|
|
];
|
|
];
|
|
- }else{
|
|
|
|
- $attach = $this->uid %2 == 0 ? 'show':'hide';
|
|
|
|
- if($attach == 'show'){
|
|
|
|
- return [
|
|
|
|
- 'price'=>'30元',
|
|
|
|
- 'text' => '30元包月 全站万本精彩小说免费看',
|
|
|
|
- 'link'=> generateMonthOrderUrl($this->uid)
|
|
|
|
- //'link'=> '/rmonthpay'
|
|
|
|
- ];
|
|
|
|
- }else{
|
|
|
|
- return '';
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
- }else{
|
|
|
|
|
|
+ }
|
|
|
|
+ $attach = $this->uid % 2 == 0 ? 'show' : 'hide';
|
|
|
|
+ if ($attach == 'hide') return '';
|
|
|
|
+ if ($property == 'low') {
|
|
return [
|
|
return [
|
|
- 'price'=>'30元',
|
|
|
|
|
|
+ 'price' => '7元',
|
|
|
|
+ 'text' => '7元包周 全站万本精彩小说免费看',
|
|
|
|
+ 'link' => generateMonthOrderUrlV2($this->uid, env('MONTH_WEEK_ORDER_PLAN_ID'), _getIp())
|
|
|
|
+ ];
|
|
|
|
+ } else {
|
|
|
|
+ return [
|
|
|
|
+ 'price' => '30元',
|
|
'text' => '30元包月 全站万本精彩小说免费看',
|
|
'text' => '30元包月 全站万本精彩小说免费看',
|
|
- 'link'=> generateMonthOrderUrl($this->uid)
|
|
|
|
- //'link'=> '/rmonthpay'
|
|
|
|
|
|
+ 'link' => generateMonthOrderUrl($this->uid)
|
|
];
|
|
];
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2329,18 +2345,19 @@ class WelcomeController extends BaseController
|
|
return '';
|
|
return '';
|
|
}
|
|
}
|
|
|
|
|
|
- private function isXiyueUser(){
|
|
|
|
|
|
+ private function isXiyueUser()
|
|
|
|
+ {
|
|
//$result = DB::table('xiyue_zsy_users')->where('uid',$this->uid)->select('id')->first();
|
|
//$result = DB::table('xiyue_zsy_users')->where('uid',$this->uid)->select('id')->first();
|
|
- if($this->distribution_channel_id == 6985){
|
|
|
|
|
|
+ if ($this->distribution_channel_id == 6985) {
|
|
return [
|
|
return [
|
|
- 'is_xiyue_user'=>1,
|
|
|
|
- 'debug'=>(int)env('XI_YUE_SHARE_DEBUG',0),
|
|
|
|
- 'xiyue_index_page'=>env('XIYUE_HOST').'/',
|
|
|
|
- 'xiyue_pay_page'=>env('XIYUE_HOST').'/',
|
|
|
|
- 'xiyue_pay_unfocus_img'=>'https://cdn-novel.iycdm.com/h5/xiyue/xiyue_pay_unfocus_img.png',
|
|
|
|
- 'xiyue_pay_focus_img'=>'https://cdn-novel.iycdm.com/h5/xiyue/xiyue_pay_focus_img.png',
|
|
|
|
- 'openid'=>$this->user->openid,
|
|
|
|
- 'register_url'=>'https://sitel12x4nj487yevw0m.leyuee.com/xiyue/sharelink'
|
|
|
|
|
|
+ 'is_xiyue_user' => 1,
|
|
|
|
+ 'debug' => (int)env('XI_YUE_SHARE_DEBUG', 0),
|
|
|
|
+ 'xiyue_index_page' => env('XIYUE_HOST') . '/',
|
|
|
|
+ 'xiyue_pay_page' => env('XIYUE_HOST') . '/',
|
|
|
|
+ 'xiyue_pay_unfocus_img' => 'https://cdn-novel.iycdm.com/h5/xiyue/xiyue_pay_unfocus_img.png',
|
|
|
|
+ 'xiyue_pay_focus_img' => 'https://cdn-novel.iycdm.com/h5/xiyue/xiyue_pay_focus_img.png',
|
|
|
|
+ 'openid' => $this->user->openid,
|
|
|
|
+ 'register_url' => 'https://sitel12x4nj487yevw0m.leyuee.com/xiyue/sharelink'
|
|
];
|
|
];
|
|
}
|
|
}
|
|
return "";
|
|
return "";
|