|
@@ -711,20 +711,44 @@ class CoflController extends Controller
|
|
|
$cookie_crm_img = Cookie::get('crm_person_img');
|
|
|
$cookie_crm_name = Cookie::get('crm_person_name','');
|
|
|
$get_info = UserBindHkWelfareService::isHasGet($uid);
|
|
|
+ $fee = $request->get('fee',200);
|
|
|
if($get_info) return back();
|
|
|
if($cookie_crm_img){
|
|
|
- return view('jump.guidePersonalAccountOurs',['img'=>$cookie_crm_img,'name'=>$cookie_crm_name]);
|
|
|
+ return view('jump.guidePersonalAccountOurs',['img'=>$cookie_crm_img,'name'=>$cookie_crm_name,'fee'=>$fee]);
|
|
|
+ }
|
|
|
+
|
|
|
+ //$distribution_channel_id = decodeDistributionChannelId($channel_id);
|
|
|
+ $distribution_channel_id = $channel_id;
|
|
|
+ //if(in_array($distribution_channel_id,Redis::SISMEMBER('')));
|
|
|
+ //$out = false;
|
|
|
+ $group = 'ACTIVE';
|
|
|
+ if(Redis::SISMEMBER('crm:out_channel_sites',$distribution_channel_id)){
|
|
|
+ //$out = true;
|
|
|
+ $group = 'OUT_ACTIVE';
|
|
|
+ $env_config = redisEnvMulti('OUT_ACTIVE_GUIDE_PERSONAL_ACCOUNT_OURS_QRCODE',
|
|
|
+ 'OUT_ACTIVE_GUIDE_PERSONAL_ACCOUNT_MAX_UV','OUT_ACTIVE_GUIDE_PERSONAL_ACCOUNT_ID',
|
|
|
+ 'OUT_ACTIVE_GUIDE_PERSONAL_ACCOUNT_MAX_EVERY_UV');
|
|
|
+ }else{
|
|
|
+ $env_config = redisEnvMulti('ACTIVE_GUIDE_PERSONAL_ACCOUNT_OURS_QRCODE',
|
|
|
+ 'ACTIVE_GUIDE_PERSONAL_ACCOUNT_MAX_UV','ACTIVE_GUIDE_PERSONAL_ACCOUNT_ID',
|
|
|
+ 'ACTIVE_GUIDE_PERSONAL_ACCOUNT_MAX_EVERY_UV');
|
|
|
}
|
|
|
-
|
|
|
- $env_config = redisEnvMulti('ACTIVE_GUIDE_PERSONAL_ACCOUNT_OURS_QRCODE',
|
|
|
- 'ACTIVE_GUIDE_PERSONAL_ACCOUNT_MAX_UV','ACTIVE_GUIDE_PERSONAL_ACCOUNT_ID',
|
|
|
- 'ACTIVE_GUIDE_PERSONAL_ACCOUNT_MAX_EVERY_UV');
|
|
|
- $img = empty($env_config[0])?'https://cdn-novel.iycdm.com/h5/personal_account/chenchen.jpg':$env_config[0];
|
|
|
+ if(empty($env_config[0])){
|
|
|
+ return back();
|
|
|
+ }
|
|
|
+ //$img = empty($env_config[0])?'https://cdn-novel.iycdm.com/h5/personal_account/chenchen.jpg':$env_config[0];
|
|
|
+ $img =$env_config[0];
|
|
|
$max = empty($env_config[1])?100:$env_config[1];
|
|
|
$max = (int)$max;
|
|
|
$one_loop_max = empty($env_config[3])?10:$env_config[3];
|
|
|
$now_id = (int)$env_config[2];
|
|
|
- $uv = Redis::scard('active_guide_personal_uv');
|
|
|
+
|
|
|
+ if($group == 'OUT_ACTIVE'){
|
|
|
+ $uv_key = 'out_active_guide_personal_uv';
|
|
|
+ }else{
|
|
|
+ $uv_key = 'active_guide_personal_uv';
|
|
|
+ }
|
|
|
+ $uv = Redis::scard($uv_key);
|
|
|
$personal_info = DB::table('personal_account_list')->where('id',$now_id)->select('count')->first();
|
|
|
if(!$personal_info){
|
|
|
return back();
|
|
@@ -748,12 +772,12 @@ class CoflController extends Controller
|
|
|
->where('is_enable',1)
|
|
|
->whereIn('status',[1,0])
|
|
|
->select('id','url')
|
|
|
- ->where('group','ACTIVE')
|
|
|
+ ->where('group',$group)
|
|
|
->where('count','<',$max)
|
|
|
->orderBy('count','asc')
|
|
|
->orderBy('id')
|
|
|
->first();
|
|
|
- Redis::del('active_guide_personal_uv');
|
|
|
+ Redis::del($uv_key);
|
|
|
if($account){
|
|
|
DB::table('personal_account_list')->where('id',$account->id)->update([
|
|
|
'status'=>1,
|
|
@@ -761,13 +785,13 @@ class CoflController extends Controller
|
|
|
]);
|
|
|
$img = $account->url;
|
|
|
$now_id = $account->id;
|
|
|
- Redis::Hmset('env','ACTIVE_GUIDE_PERSONAL_ACCOUNT_OURS_QRCODE',$account->url,'ACTIVE_GUIDE_PERSONAL_ACCOUNT_ID',$account->id);
|
|
|
+ Redis::Hmset('env',$group.'_GUIDE_PERSONAL_ACCOUNT_OURS_QRCODE',$account->url,$group.'_GUIDE_PERSONAL_ACCOUNT_ID',$account->id);
|
|
|
}else{
|
|
|
- Redis::Hmset('env','ACTIVE_GUIDE_PERSONAL_ACCOUNT_OURS_QRCODE','','ACTIVE_GUIDE_PERSONAL_ACCOUNT_ID','');
|
|
|
+ Redis::Hmset('env',$group.'_GUIDE_PERSONAL_ACCOUNT_OURS_QRCODE','',$group.'_GUIDE_PERSONAL_ACCOUNT_ID','');
|
|
|
return back();
|
|
|
}
|
|
|
}
|
|
|
- Redis::sadd('active_guide_personal_uv',$uid);
|
|
|
+ Redis::sadd($uv_key,$uid);
|
|
|
|
|
|
if($uid){
|
|
|
DB::table('ad_pdd')->insert([
|
|
@@ -798,7 +822,7 @@ class CoflController extends Controller
|
|
|
Cookie::queue('crm_person_name', $name,$time);
|
|
|
//$page = 'jump.guidePersonalAccount';
|
|
|
//$img = collect($imgs)->random();
|
|
|
- return view($page,['img'=>$img,'name'=>$name]);
|
|
|
+ return view($page,['img'=>$img,'name'=>$name,'fee'=>$fee]);
|
|
|
}
|
|
|
|
|
|
public function r(Request $request,$number){
|
|
@@ -845,7 +869,6 @@ class CoflController extends Controller
|
|
|
$user = User::where('id',$crm_transfer_uid_bind->to_uid)->select('id','distribution_channel_id')->first();
|
|
|
$uid = $crm_transfer_uid_bind->to_uid;
|
|
|
$distribution_channel_id = 5204;
|
|
|
-
|
|
|
}else{
|
|
|
list($ouid,$distribution_channel_id) = $this->getUsersV3($openid);
|
|
|
$user = $this->createUser($openid,$openid,5204,0,'');
|
|
@@ -854,35 +877,19 @@ class CoflController extends Controller
|
|
|
UserService::transfer($ouid,$uid,5204);
|
|
|
}
|
|
|
|
|
|
- if(!$user || !$user[0] || !$user[1]) return redirect()->to($this->getLink().'?'.http_build_query($params));
|
|
|
+ if(!$user || !$user[0] || !$user[1]) return redirect()->to($this->getLink($distribution_channel_id).'?'.http_build_query($params));
|
|
|
|
|
|
- $this->statsDetail($user[0],'treward',0);
|
|
|
+ $this->statsDetail($uid,'treward',0);
|
|
|
|
|
|
$get_free_currency = UserBindHkWelfareService::isHasGet($uid);
|
|
|
if($get_free_currency){
|
|
|
//已经领过
|
|
|
- if($uid){
|
|
|
- $bid = Hashids::encode($user[2]);
|
|
|
- $cid = $user[3];
|
|
|
- $params['bid'] = $bid;
|
|
|
- $params['cid'] = $cid;
|
|
|
- $link = $this->getLink($distribution_channel_id).'reader?'.http_build_query($params);
|
|
|
- }else{
|
|
|
- $link = $this->getLink($distribution_channel_id).'recent?'.http_build_query($params);
|
|
|
- }
|
|
|
+ $link = $this->getLink($distribution_channel_id).'recent?'.http_build_query($params);
|
|
|
return view('jump.bindHkFreeCurrency',['fee'=>$fee,'url'=>$link,'is_get'=>1,'uid'=>$uid,'source'=>$source]);
|
|
|
}else{
|
|
|
- if(($uid)){
|
|
|
- $bid = Hashids::encode($user[2]);
|
|
|
- $cid = $user[3];
|
|
|
- $params['bid'] = $bid;
|
|
|
- $params['cid'] = $cid;
|
|
|
- $link = $this->getLink($distribution_channel_id).'reader?'.http_build_query($params);
|
|
|
- }else{
|
|
|
- $link = $this->getLink($distribution_channel_id).'recent?'.http_build_query($params);
|
|
|
- }
|
|
|
+ $link = $this->getLink($distribution_channel_id).'recent?'.http_build_query($params);
|
|
|
$this->getReward($uid,$fee,$source,$type);
|
|
|
- return view('jump.bindHkFreeCurrency',['fee'=>$fee,'url'=>$link,'is_get'=>0,'uid'=>$user[0],'source'=>$source]);
|
|
|
+ return view('jump.bindHkFreeCurrency',['fee'=>$fee,'url'=>$link,'is_get'=>0,'uid'=>$uid,'source'=>$source]);
|
|
|
}
|
|
|
}
|
|
|
|