用户邮箱存储库我希望这些天应该在addDays()中添加日期,我将得到我的数据库public function create() { $users = User::where('user_type', 2)->get(); $auto_email_templates=AutoEmailTemplate::all()->pluck('days'); foreach ($users as $user) { if( $user->created_at > Carbon::now()->addDays($days)){ if ($user->created_at < Carbon::now()) //signup { return false; } Mail::to($user)->send(new Automail($template)); return true; }}
1 回答
慕慕森
TA贡献1856条经验 获得超17个赞
public function create()
{
$users = User::where('user_type', 2)->get();
$auto_email_templates=AutoEmailTemplate::all();
foreach ($users as $user) {
foreach($auto_email_templates as $mail){
if( $user->created_at > Carbon::now()->addDays($mail->days)){
if ($user->created_at < Carbon::now()) //signup
{
return false;
}
Mail::to($user)->send(new Automail($template));
return true;
}
- 1 回答
- 0 关注
- 71 浏览
添加回答
举报
0/150
提交
取消