|
@@ -5,6 +5,7 @@ namespace ghs\controllers;
|
|
|
use biz\merchant\services\MerchantExtendService;
|
|
use biz\merchant\services\MerchantExtendService;
|
|
|
use bizGhs\admin\classes\AdminClass;
|
|
use bizGhs\admin\classes\AdminClass;
|
|
|
use bizGhs\custom\classes\CustomClass;
|
|
use bizGhs\custom\classes\CustomClass;
|
|
|
|
|
+use bizGhs\merchant\classes\ShopClass;
|
|
|
use bizGhs\merchant\services\ShopService;
|
|
use bizGhs\merchant\services\ShopService;
|
|
|
use bizGhs\order\classes\OrderClass;
|
|
use bizGhs\order\classes\OrderClass;
|
|
|
use bizGhs\order\services\OrderItemService;
|
|
use bizGhs\order\services\OrderItemService;
|
|
@@ -56,16 +57,24 @@ class OrderController extends BaseController
|
|
|
$post['customId'] = $post['customId'] ?? 0;
|
|
$post['customId'] = $post['customId'] ?? 0;
|
|
|
$post['adminId'] = $adminId;
|
|
$post['adminId'] = $adminId;
|
|
|
$post['userId'] = 0;
|
|
$post['userId'] = 0;
|
|
|
|
|
+ $post['shopId'] = $shopId;
|
|
|
} else {
|
|
} else {
|
|
|
//供货商端 客户 开单
|
|
//供货商端 客户 开单
|
|
|
$post['userId'] = $adminId;
|
|
$post['userId'] = $adminId;
|
|
|
$post['adminId'] = 0;
|
|
$post['adminId'] = 0;
|
|
|
- $post['customId'] = CustomClass::addCustom();
|
|
|
|
|
|
|
+ $shopId = $post['shopId'] ?? 0;
|
|
|
|
|
+ if (empty($shopId)) {
|
|
|
|
|
+ util::fail('请选择供货商');
|
|
|
|
|
+ }
|
|
|
|
|
+ $post['shopId'] = $shopId;
|
|
|
|
|
+ $shop = ShopClass::getById($shopId);
|
|
|
|
|
+ if (empty($shop)) {
|
|
|
|
|
+ util::fail('没有找到供货商');
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$post['payWay'] = $this->isWx == true ? 0 : 1;
|
|
$post['payWay'] = $this->isWx == true ? 0 : 1;
|
|
|
$post['merchantId'] = $this->merchantId;
|
|
$post['merchantId'] = $this->merchantId;
|
|
|
- $post['shopId'] = 0;
|
|
|
|
|
$post['fromType'] = 1;//商城
|
|
$post['fromType'] = 1;//商城
|
|
|
$post['prePrice'] = 0.01;
|
|
$post['prePrice'] = 0.01;
|
|
|
$post['actPrice'] = 0.01;
|
|
$post['actPrice'] = 0.01;
|
|
@@ -221,11 +230,54 @@ class OrderController extends BaseController
|
|
|
util::complete();
|
|
util::complete();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //自取 shish 2021.1.22
|
|
|
|
|
- public function actionSelfGet()
|
|
|
|
|
|
|
+ //自取和免发货流程处理 shish 2021.1.22
|
|
|
|
|
+ public function actionWithoutSend()
|
|
|
{
|
|
{
|
|
|
$get = Yii::$app->request->get();
|
|
$get = Yii::$app->request->get();
|
|
|
$id = $get['id'] ?? 0;
|
|
$id = $get['id'] ?? 0;
|
|
|
|
|
+ $info = OrderClass::getOrderInfo($id);
|
|
|
|
|
+ OrderClass::valid($info, $this->shopId);
|
|
|
|
|
+ OrderClass::withoutSend($info);
|
|
|
|
|
+ util::complete();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //本店送 shish 2021.1.24
|
|
|
|
|
+ public function actionSelfSend()
|
|
|
|
|
+ {
|
|
|
|
|
+ $get = Yii::$app->request->get();
|
|
|
|
|
+ $id = isset($get['id']) ? $get['id'] : 0;
|
|
|
|
|
+ $info = OrderClass::getOrderInfo($id);
|
|
|
|
|
+ OrderClass::valid($info, $this->shopId);
|
|
|
|
|
+ OrderClass::selfSend($info);
|
|
|
|
|
+ util::complete();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //运费计算 shish 2021.1.24
|
|
|
|
|
+ public function actionFreight()
|
|
|
|
|
+ {
|
|
|
|
|
+ util::success(['sndCost' => 20]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //发快递和第三方配送 shish 2021.1.24
|
|
|
|
|
+ public function actionThirdSend()
|
|
|
|
|
+ {
|
|
|
|
|
+ $respond = [
|
|
|
|
|
+ 'sendSide' => '达达',
|
|
|
|
|
+ 'distance' => 5.5,
|
|
|
|
|
+ 'sendCost' => 20,
|
|
|
|
|
+ 'status' => 1,
|
|
|
|
|
+ 'tip' => 5,
|
|
|
|
|
+ ];
|
|
|
|
|
+ util::success($respond);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //确认送达 shish 2021.1.24
|
|
|
|
|
+ public function actionReach()
|
|
|
|
|
+ {
|
|
|
|
|
+ $get = Yii::$app->request->get();
|
|
|
|
|
+ $id = isset($get['id']) ? $get['id'] : 0;
|
|
|
|
|
+ $info = OrderClass::getOrderInfo($id);
|
|
|
|
|
+ OrderClass::valid($info, $this->shopId);
|
|
|
util::complete();
|
|
util::complete();
|
|
|
}
|
|
}
|
|
|
|
|
|