询单接口&调整脚手架

This commit is contained in:
mzl
2025-07-23 15:02:09 +08:00
parent 283b21b1f8
commit b22db8ac35
12 changed files with 285 additions and 167 deletions
+22 -11
View File
@@ -54,14 +54,9 @@ class InquiryLogService
// 时间
if (isset($p['time']) && $p['time']) {
// $time = explode(' - ', $p['time']);
// $config['where']['created_at'] = [
// ['>=', strtotime($time[0])],
// ['<=', strtotime($time[1])],
// ];
$time = explode(' - ', $p['time']);
$config['where']['created_at'] = [
strtotime(explode(' - ', $p['time'])[0]),
strtotime(explode(' - ', $p['time'])[1]),
'between', [strtotime($time[0]), strtotime($time[1])]
];
}
@@ -79,15 +74,13 @@ class InquiryLogService
}
// 关联
$config['with'][] = 'country';
$config['with']['enter'][] = 'id';
$config['with']['country'][] = 'cn_addr';
$config['with']['enter'][] = 'name';
$config['with']['recipient'][] = 'id';
$config['with']['recipient'][] = 'name';
$config['with']['channel'][] = 'name';
break;
case 'show':
$config['where']['id'] = $p['id'];
$config['where']['status'] = 1;
break;
case 'store':
break;
@@ -101,4 +94,22 @@ class InquiryLogService
return $config;
}
public function beforeServiceStore($data, Request $request)
{
$data['order_no'] = orderNum();
$data['enter_user_id'] = $request->user->uid;
$data['recipient'] = 0;
$data['email'] = trim($data["email"]);
$data['tel'] = trim($data['tel']);
$data['whatsapp'] = trim($data['whatsapp']);
return $data;
}
// public function afterServiceList($data)
// {
// var_dump($data);
// return $data;
// }
}