1
This commit is contained in:
@@ -107,6 +107,26 @@ class UsedCarService
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function beforeServiceUpdate($data, Request $request): array
|
||||||
|
{
|
||||||
|
if (empty($data['product_name'])) {
|
||||||
|
throw new BusinessException('产品名称不能为空');
|
||||||
|
}
|
||||||
|
if (empty($data['images'])) {
|
||||||
|
throw new BusinessException('产品图片不能为空');
|
||||||
|
}
|
||||||
|
if (empty($data['price'])) {
|
||||||
|
$data['price'] = 0;
|
||||||
|
}
|
||||||
|
if (!empty($data['attachment'])) {
|
||||||
|
$data['attachment'] = json_encode($data['attachment']);
|
||||||
|
}else{
|
||||||
|
$data['attachment'] = '';
|
||||||
|
}
|
||||||
|
$data['mileage'] = str_replace(['K','M','k','m'], '', $data['mileage']);
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
public function getcode($userId){
|
public function getcode($userId){
|
||||||
$userCount = Redis::get('used_car_count_'.$userId, 0);
|
$userCount = Redis::get('used_car_count_'.$userId, 0);
|
||||||
$todayStart = strtotime('today');
|
$todayStart = strtotime('today');
|
||||||
|
|||||||
Reference in New Issue
Block a user