|
@@ -268,7 +268,14 @@ WHERE openid in (SELECT openid FROM users WHERE id = $uid)";
|
|
|
$result = UserDivisionCpcPropertyV2::where('openid',$openid)->where('is_enable',1)->select('property')->first();
|
|
|
if($result)
|
|
|
return $result->property;
|
|
|
- return 'none';
|
|
|
+ $sql_format = 'select id,created_at from users WHERE openid="%s" ORDER by created_at limit 1';
|
|
|
+ $info = DB::select(sprintf($sql_format,$openid));
|
|
|
+ if(!$info) return 'unknown';
|
|
|
+ foreach ($info as $item){
|
|
|
+ if( time()-strtotime($item->created_at) > 3*86400 )
|
|
|
+ return 'none';
|
|
|
+ }
|
|
|
+ return 'unknown';
|
|
|
}
|
|
|
|
|
|
public static function getUserPropertyV2($uid){
|
|
@@ -277,7 +284,14 @@ WHERE openid in (SELECT openid FROM users WHERE id = $uid)";
|
|
|
->select('user_division_cpc_property_v2.property')->first();
|
|
|
if($result)
|
|
|
return $result->property;
|
|
|
- return 'none';
|
|
|
+ $sql_format = 'select id,created_at from users WHERE openid = (select openid FROM users WHERE id=%s) ORDER by created_at limit 1';
|
|
|
+ $info = DB::select(sprintf($sql_format,$uid));
|
|
|
+ if(!$info) return 'unknown';
|
|
|
+ foreach ($info as $item){
|
|
|
+ if( time()-strtotime($item->created_at) > 3*86400 )
|
|
|
+ return 'none';
|
|
|
+ }
|
|
|
+ return 'unknown';
|
|
|
}
|
|
|
|
|
|
public static function updateV2($openid,$property=''){
|