Răsfoiți Sursa

商城下单 地址相关

shish 6 ani în urmă
părinte
comite
a262fd5f26

+ 15 - 1
app/business/controllers/OrderController.php

@@ -2,8 +2,11 @@
 
 namespace business\controllers;
 
+use biz\merchant\services\MerchantExtendService;
 use biz\merchant\services\MerchantService;
+use biz\merchant\services\ShopService;
 use biz\order\services\OrderService;
+use biz\saas\services\RegionService;
 use biz\user\services\UserService;
 use common\components\configDict;
 use common\services\xhPayToolService;
@@ -135,5 +138,16 @@ class OrderController extends BaseController
 		OrderService::updateById($id, ['actPrice' => $price]);
 		util::ok('修改成功');
 	}
-	
+
+	//下单要用到的相关信息 shish 2019.12.6
+	public function actionOrderRelate()
+	{
+		$regionTree = RegionService::tree();
+		$shop = ShopService::getDefaultShop($this->merchant);
+		$freight = MerchantExtendService::getFreight($this->merchantExtend);
+		$mapKey = 'OFWBZ-2NTHP-EHNDD-LKWQY-GANM7-PXBJH';
+		$out = ['freight' => $freight, 'shop' => $shop, 'region' => $regionTree, 'txMapKey' => $mapKey];
+		util::success($out);
+	}
+
 }

+ 40 - 0
app/www/controllers/InformUserController.php

@@ -0,0 +1,40 @@
+<?php
+
+namespace www\controllers;
+
+use biz\message\services\SmsService;
+use biz\user\services\UserAssetService;
+use biz\user\services\UserService;
+use common\components\sms;
+use common\components\stringUtil;
+use Yii;
+use common\components\util;
+use yii\helpers\Json;
+
+class InformUserController extends BaseController
+{
+	
+	//发送短信
+	public function actionSendSms()
+	{
+		$get = Yii::$app->request->get();
+		$type = isset($get['type']) ? $get['type'] : 0;
+		$mobile = isset($get['mobile']) ? $get['mobile'] : 0;
+		if (stringUtil::isMobile($mobile) == false) {
+			util::fail('请填写手机号');
+		}
+
+		$code = stringUtil::getRandNum(4);
+		$msg = "您的验证码:" . $code . "。为了您的帐号安全,验证码不要告诉别人哦";
+		$userId = $this->userId;
+
+		if ($type == 1) {
+
+		} else {
+			util::fail('发送失败');
+		}
+		sms::send($mobile, $msg);
+		util::ok('已发送');
+	}
+
+}