|
|
@@ -26,6 +26,46 @@ use common\components\util;
|
|
|
class OrderController extends BaseController
|
|
|
{
|
|
|
|
|
|
+ //计算运费 ssh 20221003
|
|
|
+ public function actionFreight()
|
|
|
+ {
|
|
|
+ $get = Yii::$app->request->get();
|
|
|
+
|
|
|
+ util::success(['distance' => 1, 'showDistance' => 1, 'fee' => 1]);
|
|
|
+
|
|
|
+// $shop = $this->shop;
|
|
|
+// $shopLat = isset($shop->lat) ? $shop->lat : '';
|
|
|
+// $shopLong = isset($shop->long) ? $shop->long : '';
|
|
|
+//
|
|
|
+// if (empty($shopLat) || empty($shopLong)) {
|
|
|
+// util::success(['distance' => 0, 'showDistance' => 0, 'fee' => 0]);
|
|
|
+// }
|
|
|
+//
|
|
|
+// $ghsId = $get['ghsId'] ?? 0;
|
|
|
+// $ghs = GhsClass::getById($ghsId, true);
|
|
|
+// if (empty($ghs)) {
|
|
|
+// util::success(['distance' => 0, 'showDistance' => 0, 'fee' => 0]);
|
|
|
+// }
|
|
|
+// $ghsShopId = $ghs->shopId ?? 0;
|
|
|
+// $ghsShop = ShopClass::getById($ghsShopId, true);
|
|
|
+// if (empty($ghsShop)) {
|
|
|
+// util::success(['distance' => 0, 'showDistance' => 0, 'fee' => 0]);
|
|
|
+// }
|
|
|
+//
|
|
|
+// $ghsShopLat = isset($ghsShop->lat) ? $ghsShop->lat : '';
|
|
|
+// $ghsShopLong = isset($ghsShop->long) ? $ghsShop->long : '';
|
|
|
+// if (empty($ghsShopLat) || empty($ghsShopLong)) {
|
|
|
+// util::success(['distance' => 0, 'showDistance' => 0, 'fee' => 0]);
|
|
|
+// }
|
|
|
+//
|
|
|
+// $weight = $get['weight'] ?? 0;
|
|
|
+// if (empty($weight)) {
|
|
|
+// util::success(['distance' => 0, 'showDistance' => 0, 'fee' => 0]);
|
|
|
+// }
|
|
|
+// $respond = PurchaseClass::getDistanceFee($this->shop, $ghsShop, $weight);
|
|
|
+// util::success($respond);
|
|
|
+ }
|
|
|
+
|
|
|
//购买花材 ssh 20220511
|
|
|
public function actionBuyItem()
|
|
|
{
|