作者 李美松

逻辑 - 数据更新

... ... @@ -39,7 +39,7 @@ class ProjectFilePDF extends Command
{
$this->AiccWechat = new ProjectAssociation();
$this->DataFile = new DataFile();
$this->time = date("Y-m-d");
$this->time = date("Y-m");
parent::__construct();
}
... ... @@ -121,9 +121,12 @@ class ProjectFilePDF extends Command
// 获取PDF内容
$pdfContent = $dompdf->output();
$pdf_path = public_path('PDF/');
if (!file_exists($pdf_path)) {
mkdir($pdf_path, 0777, true);
}
// 指定保存路径和文件名
$savePath = public_path('PDF/' . $filename . '.pdf');
$savePath = $pdf_path . $filename . '.pdf';
// 将PDF内容保存到文件
file_put_contents($savePath, $pdfContent);
... ...
... ... @@ -28,11 +28,11 @@ class ProjectAssociation extends Model
# AICC朋友昵称
$isRes->nickname = $data['nickname'] ?? 0;
# AICC用户ID
$isRes->user_id = $data['user_id'] ?? 0;
$isRes->user_id = $data['user_id'] ?? 0;
# AICC用户姓名
$isRes->user_name = $data['user_name'] ?? '';
# AICC朋友头像
$isRes->image = $data['image'] ?? '';
$isRes->image = $data['image'] ?? '';
return $isRes->save();
}
... ... @@ -55,9 +55,9 @@ class ProjectAssociation extends Model
{
$status = 1; # 1 - 正常, 0 - 禁用
$lists = self::query()->where('status', $status)
->whereNotNull('project_id')
->whereNotNull('friend_id')
->whereNotNull('user_id')
->where('project_id', '!=', 0)
->where('friend_id', '!=', 0)
->where('user_id', '!=', 0)
->paginate($perPage, ['project_id', 'friend_id', 'user_id'], 'page', $page);
$items = $lists->Items();
$totalPage = $lists->lastPage();
... ...