|
@@ -97,9 +97,27 @@ class CoflController extends Controller
|
|
|
$get_free_currency = UserBindHkWelfareService::isHasGet($user[0]);
|
|
|
if($get_free_currency){
|
|
|
//已经领过
|
|
|
- return view('jump.bindHkFreeCurrency',['fee'=>$fee,'url'=>$this->getLink($get_free_currency->distribution_channel_id).'?'.http_build_query($params),'is_get'=>1,'uid'=>$get_free_currency->uid]);
|
|
|
+ if(isset($user[2]) && !empty($user[2]) && isset($user[3]) && !empty($user[3])){
|
|
|
+ $bid = Hashids::encode($user[2]);
|
|
|
+ $cid = $user[3];
|
|
|
+ $params['bid'] = $bid;
|
|
|
+ $params['cid'] = $cid;
|
|
|
+ $link = $this->getLink($get_free_currency->distribution_channel_id).'reader?'.http_build_query($params);
|
|
|
+ }else{
|
|
|
+ $link = $this->getLink($get_free_currency->distribution_channel_id).'?'.http_build_query($params);
|
|
|
+ }
|
|
|
+ return view('jump.bindHkFreeCurrency',['fee'=>$fee,'url'=>$link,'is_get'=>1,'uid'=>$get_free_currency->uid]);
|
|
|
}else{
|
|
|
- return view('jump.bindHkFreeCurrency',['fee'=>$fee,'url'=>$this->getLink($user[1]).'?'.http_build_query($params),'is_get'=>0,'uid'=>$user[0]]);
|
|
|
+ if(isset($user[2]) && !empty($user[2]) && isset($user[3]) && !empty($user[3])){
|
|
|
+ $bid = Hashids::encode($user[2]);
|
|
|
+ $cid = $user[3];
|
|
|
+ $params['bid'] = $bid;
|
|
|
+ $params['cid'] = $cid;
|
|
|
+ $link = $this->getLink($user[1]).'reader?'.http_build_query($params);
|
|
|
+ }else{
|
|
|
+ $link = $this->getLink($user[1]).'?'.http_build_query($params);
|
|
|
+ }
|
|
|
+ return view('jump.bindHkFreeCurrency',['fee'=>$fee,'url'=>$link,'is_get'=>0,'uid'=>$user[0]]);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -225,10 +243,12 @@ class CoflController extends Controller
|
|
|
|
|
|
private function getUsers($openid){
|
|
|
$users = User::where('openid',$openid)->select('id','distribution_channel_id')->get();
|
|
|
- if($users->isEmpty()) return [0,0];
|
|
|
+ if($users->isEmpty()) return [0,0,0,0];
|
|
|
$temp = null;
|
|
|
$distribution_channel_id = 0;
|
|
|
$uid = 0;
|
|
|
+ $bid = 0;
|
|
|
+ $cid = 0;
|
|
|
foreach ($users as $user){
|
|
|
$last_read = ReadRecordService::getByField($user->id,'last_read');
|
|
|
if(!$last_read) continue;
|
|
@@ -243,10 +263,12 @@ class CoflController extends Controller
|
|
|
$uid = $user->id;
|
|
|
$distribution_channel_id = $user->distribution_channel_id;
|
|
|
$temp = $last_read;
|
|
|
+ $bid = $last_read_info[0];
|
|
|
+ $cid = $last_read_info[1];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- return [$uid,$distribution_channel_id];
|
|
|
+ return [$uid,$distribution_channel_id,$bid,$cid];
|
|
|
}
|
|
|
|
|
|
private function getLink($distribution_channel_id=123){
|