Sfoglia il codice sorgente

获取商家 extend

shish 6 anni fa
parent
commit
a0864e3fda

+ 3 - 1
app/mobile/controllers/BaseController.php

@@ -2,6 +2,7 @@
 
 namespace mobile\controllers;
 
+use biz\merchant\services\MerchantExtendService;
 use biz\merchant\services\MerchantService;
 use biz\user\services\UserService;
 use common\components\httpUtil;
@@ -20,7 +21,7 @@ class BaseController extends PublicController
 	public $validate = true;
 	public $withoutLogin = [];//不需要登陆可以访问的方法
 	public $userId, $user;
-	public $merchantId, $merchant;
+	public $merchantId, $merchant, $merchantExtend;
 	public $isWeixin;
 	
 	public function beforeAction($action)
@@ -39,6 +40,7 @@ class BaseController extends PublicController
 		}
 		$this->merchantId = $account;
 		$this->merchant = $merchant;
+		$this->merchantExtend = MerchantExtendService::getByMerchantId($account);
 		
 		$this->isWeixin = util::isWeixin();
 		

+ 18 - 0
biz/merchant/classes/MerchantExtendClass.php

@@ -0,0 +1,18 @@
+<?php
+
+namespace biz\merchant\classes;
+
+use Yii;
+use biz\base\classes\BaseClass;
+
+class MerchantExtendClass extends BaseClass
+{
+	
+	public static $baseFile = '\biz\merchant\models\MerchantExtend';
+
+	public static function getByMerchantId($id, $returnType = false)
+	{
+		return self::getByCondition(['merchantId' => $id], $returnType);
+	}
+
+}

+ 17 - 0
biz/merchant/models/MerchantExtend.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace biz\merchant\models;
+
+use biz\base\models\Base;
+
+class MerchantExtend extends Base
+{
+	/**
+	 * @inheritdoc
+	 */
+	public static function tableName()
+	{
+		return 'xhMerchantExtend';
+	}
+	
+}

+ 19 - 0
biz/merchant/services/MerchantExtendService.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace biz\merchant\services;
+
+use biz\base\services\BaseService;
+use biz\merchant\classes\MerchantExtendClass;
+use Yii;
+
+class MerchantExtendService extends BaseService
+{
+	
+	public static $baseFile = '\biz\merchant\classes\MerchantExtendClass';
+	
+	public static function getByMerchantId($id, $returnType = false)
+	{
+		return MerchantExtendClass::getByMerchantId($id, $returnType);
+	}
+	
+}