|
@@ -52,12 +52,21 @@ class CheckOrderStatus extends Command
|
|
|
if($uid) {
|
|
|
$this->checkOne($uid);
|
|
|
}else{
|
|
|
- $result = UserMonthSign::where('created_at','>=',date('Y-m-d H:i:s',time()-1800))->select('uid')->get();
|
|
|
- if($result->isNotEmpty()){
|
|
|
+ $sql_format = 'SELECT uid FROM user_month_sign WHERE created_at >= DATE_ADD(NOW(),INTERVAL -1 hour) and
|
|
|
+NOT EXISTS (SELECT id FROM user_month_order WHERE user_month_order.uid =user_month_sign.uid and created_at BETWEEN "%s" and "%s" )';
|
|
|
+ $sql = sprintf($sql_format,date('Y-m-01'),date('Y-m-01',strtotime('+1 month')));
|
|
|
+ $result = DB::select($sql);
|
|
|
+ if($result){
|
|
|
foreach ($result as $item){
|
|
|
$this->checkOne($item->uid);
|
|
|
}
|
|
|
}
|
|
|
+ /*$result = UserMonthSign::where('created_at','>=',date('Y-m-d H:i:s',time()-1800))->select('uid')->get();
|
|
|
+ if($result->isNotEmpty()){
|
|
|
+ foreach ($result as $item){
|
|
|
+ $this->checkOne($item->uid);
|
|
|
+ }
|
|
|
+ }*/
|
|
|
}
|
|
|
}
|
|
|
public function checkOne($uid){
|