Browse Source

续费更新

shish 6 năm trước cách đây
mục cha
commit
fba3ccbe22

+ 13 - 2
app/client/controllers/MerchantController.php

@@ -3,6 +3,7 @@
 namespace client\controllers;
 
 use biz\merchant\services\MerchantExtendService;
+use biz\merchant\services\MerchantService;
 use biz\merchant\services\ShopService;
 use Yii;
 use yii\web\Controller;
@@ -18,19 +19,29 @@ class MerchantController extends BaseController
 		$merchant['defaultShop'] = ShopService::getDefaultShopInfo($merchant);
 		util::success($merchant);
 	}
-
+	
 	//当前用户获取商家信息
 	public function actionGetInfo()
 	{
 		$merchant = $this->merchant;
 		util::success($merchant);
 	}
-
+	
 	//客户的会员等级 shish 2020.1.2
 	public function actionUserGrade()
 	{
 		$list = MerchantExtendService::getGradeList($this->merchantExtend, 'asc', false);
 		util::success($list);
 	}
+	
+	//获取商家的到期时间 shish 2020.2.22
+	public function actionGetDeadline()
+	{
+		$id = Yii::$app->request->get('merchantId');
+		$merchant = MerchantService::getById($id);
+		$deadline = $merchant['setDeadline'];
+		$date = date("Y-m-d H:i", $deadline);
+		util::success(['date' => $date]);
+	}
 
 }

+ 4 - 10
app/www/controllers/RenewController.php

@@ -14,14 +14,14 @@ use Yii;
 
 class RenewController extends BaseController
 {
-
+	
 	public function actionList()
 	{
 		$where = [];
 		$list = RenewService::getRenewList($where);
 		util::success($list);
 	}
-
+	
 	//微信支付购买 shish 2020.1.11
 	public function actionWxPay()
 	{
@@ -94,14 +94,8 @@ class RenewController extends BaseController
 		$jsApiParameters = $tools->GetJsApiParameters($wxOrder, $merchantExtend);
 		$newParams = json_decode($jsApiParameters, true);
 		$newParams['orderId'] = $orderId;
+		$newParams['merchantId'] = $merchantId;
 		util::success($newParams);
 	}
-
-	//续费成功 shish 2020.2.21
-	public function actionSuccess()
-	{
-		$orderId = Yii::$app->request->get('orderId', 0);
-		util::success(['deadline' => '2021-02-21 20:00']);
-	}
-
+	
 }

+ 2 - 2
common/components/jsSDK.php

@@ -29,10 +29,10 @@ class jsSDK
 		return $signPackage;
 	}
 	
-	public function getSignPackage($merchant)
+	public function getSignPackage($merchant,$url)
 	{
 		$jsapiTicket = $this->getJsApiTicket($merchant);
-		$url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
+		//$url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
 		$timestamp = time();
 		$nonceStr = $this->createNonceStr();
 		$string = "jsapi_ticket=$jsapiTicket&noncestr=$nonceStr&timestamp=$timestamp&url=$url";// 这里参数的顺序要按照 key 值 ASCII 码升序排序