|
|
@@ -181,8 +181,6 @@ class ServiceOrderLogic extends BaseLogic
|
|
|
$work_data['data_type'] = 1;
|
|
|
}
|
|
|
|
|
|
- $service_area_id = ServiceArea::serviceAreaId(['lon' => $work_data['lon'], 'lat' => $work_data['lat']]);
|
|
|
- $work_data['service_area_id'] = $service_area_id;
|
|
|
$service_work = ServiceWork::create($work_data);
|
|
|
|
|
|
|
|
|
@@ -1125,6 +1123,8 @@ class ServiceOrderLogic extends BaseLogic
|
|
|
{
|
|
|
Db::startTrans();
|
|
|
try {
|
|
|
+ // 订单位置是否在服务区内
|
|
|
+ $areas = self::isService($params);
|
|
|
$goods = Goods::findOrEmpty($params['goods_id']);
|
|
|
if($goods->isEmpty()){
|
|
|
throw new Exception('产品不存在!');
|
|
|
@@ -1146,7 +1146,7 @@ class ServiceOrderLogic extends BaseLogic
|
|
|
$order_total = $goods['base_service_fee'];
|
|
|
$order_amount = $goods['service_fee'];
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//生成服务工单
|
|
|
$work_data = [
|
|
|
'work_sn' => generate_sn(ServiceWork::class, 'work_sn'),
|
|
|
@@ -1165,9 +1165,12 @@ class ServiceOrderLogic extends BaseLogic
|
|
|
'user_id'=>$params['user_id'],
|
|
|
'lon'=>!empty($params['lon'])?$params['lon']:0,
|
|
|
'lat'=>!empty($params['lat'])?$params['lat']:0,
|
|
|
+
|
|
|
+ 'province' => $areas['province']??0,
|
|
|
+ 'city' => $areas['city']??0,
|
|
|
+ 'area_name' => $areas['area_name']??'',
|
|
|
+ 'service_area_id' => $areas['id']??0,
|
|
|
];
|
|
|
- $service_area_id = ServiceArea::getAreaId(['lon' => $work_data['lon'], 'lat' => $work_data['lat']]);
|
|
|
- $work_data['service_area_id'] = $service_area_id;
|
|
|
$service_work = ServiceWork::create($work_data);
|
|
|
//生成服务订单
|
|
|
$data = [
|