用户信息、个人名片、加密、水印

This commit is contained in:
2026-01-13 15:16:00 +08:00
parent b7ef05566b
commit 89399d9159
8 changed files with 107 additions and 190 deletions
+9 -2
View File
@@ -4,6 +4,7 @@ namespace app\common\controller;
use app\common\controller\BaseController;
use app\common\model\UsedCar;
use app\common\model\UsedCarPdfLog;
use app\common\model\User;
use app\common\service\OssService;
use app\common\traits\crud\CrudControllerTrait;
use app\common\service\UsedCarService;
@@ -138,8 +139,14 @@ class UsedCarController extends BaseController
}
$data['attachment'] = $attachments;
$data['price'] = $price;
$pdf = (new MpdfDriver())->exportUsedCarPdf($data);
$user = User::where('id',$request->user['id'])->first();
$contact = $user['email'] ?? $user['phone'] ?? $user['whatsapp'] ?? null;
if(!empty($user['social_code'])){
$ossService = new OssService();
$user['social_code'] = $ossService->generatePrivateUrl($user['social_code']);
$user['social_code'] = $this->service->downloadImage($user['social_code']);
}
$pdf = (new MpdfDriver())->exportUsedCarPdf($data,$user,$contact);
UsedCar::where('id', $data['id'])->update(['pdf_src' => $pdf]);
array_map('unlink', glob(runtime_path('pdf/images/*.jpg')));