call(function (){ $dayTime1=date("Y-m-d 00:00:00",strtotime("-3 days")); $dayTime2=date("Y-m-d 23:59:59",strtotime("-3 days")); $users = User::where('cert_status',2)->whereBetween('created_at',[$dayTime1,$dayTime2])->get(); foreach($users as $key=>$val){ $agent=User::where('id',$val->agent_id)->first(); if($agent->openid){ Log::info('-----'.$val->mobile.'------审核提醒1-----------'.$agent->openid); $mes['openid']=$agent->openid; $mes['data']=[ 'first' => '注册信息已提交,请您及时审核', 'keyword1' => $val->nickname, 'keyword2' => $val->mobile, 'keyword3' => date("Y-m-d H:i"), 'remark' => '点击链接进入系统,查看详情', ]; event(new RegisterApplyEvent($mes)); } } })->dailyAt('10:00'); } public function code($phone){ $data=code($phone); $re=DB::table('users')->where('recom_code',$data)->first(); if ($re){ $data=$this->code($phone); return $data; } return $data; } public function auth_code($phone){ $code_1=str_pad(random_int(1, 999), 3, 0, STR_PAD_LEFT); $code_2=mb_substr($phone,1,3); $code_3=str_pad(random_int(100, 99999), 6, 0, STR_PAD_LEFT); $code_4=mb_substr(time(),8,2); $code='DWBS00'.$code_1.date('ymd',time()).$code_2.$code_3.$code_4; $re=DB::table('users')->where('auth_code',$code)->first(); if ($re){ $code=$this->auth_code($phone); return $code; } return $code; } }