|
|
@@ -15,6 +15,7 @@
|
|
|
namespace app\adminapi\logic\works;
|
|
|
|
|
|
use app\adminapi\logic\user\UserLogic;
|
|
|
+use app\api\logic\ServiceOrderLogic;
|
|
|
use app\api\logic\UserCouponLogic;
|
|
|
use app\common\enum\ThirdTypeEnum;
|
|
|
use app\common\enum\worker\WorkerAccountLogEnum;
|
|
|
@@ -1313,4 +1314,39 @@ class ServiceWorkLogic extends BaseLogic
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 给用户加单
|
|
|
+ */
|
|
|
+ public static function userExtendOrder($params): bool
|
|
|
+ {
|
|
|
+ try {
|
|
|
+ $serviceWork = ServiceWork::where('id',$params['id'])->findOrEmpty();
|
|
|
+ if(!$serviceWork->isEmpty()){
|
|
|
+ //goods_id ['user_info']['mobile'] user_id coupon_id=0 worker=1 terminal=1 pay_way=2 address contact_people=real_name contact_number=mobile appointment_time lon lat property_activity_id=0
|
|
|
+ ServiceOrderLogic::submitOrder([
|
|
|
+ 'goods_id' => $serviceWork->goods_id,
|
|
|
+ 'user_info' => [
|
|
|
+ 'mobile' => $serviceWork->mobile
|
|
|
+ ],
|
|
|
+ 'user_id' => $serviceWork->user_id,
|
|
|
+ 'coupon_id' => 0,
|
|
|
+ 'worker' => 1,
|
|
|
+ 'terminal' => 1,
|
|
|
+ 'pay_way' => 2,
|
|
|
+ 'appointment_time' => $serviceWork->appointment_time,
|
|
|
+ 'address' => $serviceWork->address,
|
|
|
+ 'contact_people' => $serviceWork->real_name,
|
|
|
+ 'contact_number' => $serviceWork->mobile,
|
|
|
+ 'lon' => $serviceWork->lon,
|
|
|
+ 'lat' => $serviceWork->lat,
|
|
|
+ 'property_activity_id' => 0
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ self::setError($e->getMessage());
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|