refactor(app): 优化邮件模板

master
cody 4 weeks ago
parent 8b8ec54e38
commit 2c8157ffd5

@ -43,18 +43,19 @@ class UpdateUserNo extends Command
public function handle()
{
// 已经开始的课程日期(所有历史数据处理)
$dateList = Course::whereNotNull('start_date')
->where('start_date', '<=', date('Y-m-d'))
->orderBy('start_date')
->groupBy('start_date')
->pluck('start_date')
->toArray();
// $dateList = Course::whereNotNull('start_date')
// ->where('start_date', '<=', date('Y-m-d'))
// ->orderBy('start_date')
// ->groupBy('start_date')
// ->pluck('start_date')
// ->toArray();
// 当日数据处理(日常定时任务)
//$dateList = [date('Y-m-d')];
$dateList = [date('Y-m-d')];
foreach ($dateList as $date) {
$courses = Course::with(['courseSigns' => function ($query) {
$query->where('status', 1);
}])->where('start_date', $date)
->whereNotNull('student_prefix')
->orderBy('start_date')
->get();
$i = 1;

@ -3,6 +3,7 @@
namespace App\Http\Controllers\Admin;
use App\Exports\BaseExport;
use App\Exports\CommonExport;
use App\Helpers\ResponseCode;
use App\Models\AppointmentType;
use App\Models\CustomForm;
@ -101,12 +102,8 @@ class SupplyDemandController extends BaseController
}
})->orderBy($all['sort_name'] ?? 'id', $all['sort_type'] ?? 'desc');
if (isset($all['is_export']) && !empty($all['is_export'])) {
$list = $list->get()->toArray();
$export_fields = $all['export_fields'] ?? [];
// 导出文件名字
$tableName = $this->model->getTable();
$filename = (new CustomForm())->getTableComment($tableName);
return Excel::download(new BaseExport($export_fields, $list, $tableName), $filename . date('YmdHis') . '.xlsx');
$list = $list->limit(5000)->get()->toArray();
return Excel::download(new CommonExport($list, $all['export_fields'] ?? ''), $all['file_name'] ?? '' . date('YmdHis') . '.xlsx');
} else {
// 输出
$list = $list->paginate($all['page_size'] ?? 20);

Loading…
Cancel
Save