فهرست منبع

删除无用文件

shish 6 سال پیش
والد
کامیت
0e69ae9c01

+ 118 - 119
app/business/controllers/BaseController.php

@@ -2,7 +2,6 @@
 
 namespace business\controllers;
 
-use biz\admin\services\AdminToMerchantService;
 use biz\merchant\services\AdminService;
 use biz\merchant\services\MerchantAssetService;
 use biz\merchant\services\MerchantExtendService;
@@ -12,123 +11,123 @@ use common\components\util;
 
 class BaseController extends PublicController
 {
-    public $admin, $adminId, $adminAvatar, $account;
-    public $merchantId = 0, $merchantName, $merchant, $merchantExtend, $merchantAsset, $merchantLogo, $signPackage;
-    public $openMerchant, $openMerchantId;
-    public $appId;
-    public $isWeixin = false;
-    public $isLogin = false;
-    public $withoutLogin = [];//不需要登陆的方法名
-    public $validate = true;
-
-    // Service 模型实例
-    protected $service;
-    // 设置允许与不允许方法 shizq 2019-12-05
-    protected $allowActions = [];
-    protected $notAllowActions = [];
-
-    public function beforeAction($action)
-    {
-        //token验证
-        //$adminId = jwt::getLoginId();
-        $adminId = 1;
-        if (empty($adminId)) {
-            $this->validate = false;
-        }
-
-        //方法开放设置 shizq 2019-12-05
-        if (in_array($action->id, $this->notAllowActions)) {
-            util::fail($action->id . ' not allow');
-        }
-
-        //游客可以访问的方法
-        if (in_array($action->id, $this->withoutLogin)) {
-            $this->validate = true;
-        }
-        if ($this->validate == false) {
-            util::notLogin();
-        }
-        $admin = AdminService::getById($adminId);
-        if (empty($admin)) {
-            util::fail('没有找到管理员');
-        }
-        $merchantId = AdminToMerchantService::getDefaultMerchant($adminId);
-        if (empty($merchantId)) {
-            util::fail('没有找到商家信息');
-        }
-        $merchant = MerchantService::getById($merchantId);
-        $merchantExtend = MerchantExtendService::getByMerchantId($merchantId);
-        $merchantAsset = MerchantAssetService::getByMerchantId($merchantId);
-        Yii::$app->params['adminId'] = $adminId;
-        Yii::$app->params['admin'] = $admin;
-        Yii::$app->params['merchantId'] = $merchantId;
-        Yii::$app->params['merchant'] = $merchant;
-        Yii::$app->params['merchant'] = $merchant;
-        Yii::$app->params['merchantAsset'] = $merchantAsset;
-        Yii::$app->params['merchantExtend'] = $merchantExtend;
-        $this->adminId = $adminId;
-        $this->merchantId = $merchantId;
-        $this->merchant = $merchant;
-        $this->merchantExtend = $merchantExtend;
-        $this->merchantAsset = $merchantAsset;
-        return parent::beforeAction($action);
-    }
-
-    public function actionList()
-    {
-        $numargs = func_num_args();
-        $select = $numargs >= 1 ? func_get_arg(0) : '*';
-        $where = $numargs >= 2 ? func_get_arg(1) : null;
-        $order = $numargs >= 3 ? func_get_arg(2) : '';
-        $with = $numargs >= 4 ? func_get_arg(3) : '';
-
-        $service = $this->service;
-        $list = $service::getList($select, $where, $order, $with);
-        util::success($list);
-    }
-
-    public function actionAdd()
-    {
-        $data = Yii::$app->request->post();
-        $service = $this->service;
-        $re = $service::add($data);
-        util::success($re);
-    }
-
-    public function actionDetail()
-    {
-        $id = Yii::$app->request->get('id');
-        $service = $this->service;
-        $data = $service::getById($id);
-        if (isset($data['merchantId']) == false || $this->merchantId != $data['merchantId']) {
-            util::fail('没有权限');
-        }
-        if (!empty($data)) {
-            util::success($data);
-        }
-
-        util::fail('');
-    }
-
-    public function actionUpdate()
-    {
-        $data = Yii::$app->request->post();
-        $id = $data['id'];
-        $service = $this->service;
-        $re = $service::updateById($id, $data);
-        if ($re['status'] === true) {
-            util::success($re);
-        }
-
-        util::fail();
-    }
-
-    public function actionDelete()
-    {
-        $id = Yii::$app->request->get('id');
-        $service = $this->service;
-        $service::deleteById($id);
-        util::success([], '删除成功');
-    }
+	public $admin, $adminId, $adminAvatar, $account;
+	public $merchantId = 0, $merchantName, $merchant, $merchantExtend, $merchantAsset, $merchantLogo, $signPackage;
+	public $openMerchant, $openMerchantId;
+	public $appId;
+	public $isWeixin = false;
+	public $isLogin = false;
+	public $withoutLogin = [];//不需要登陆的方法名
+	public $validate = true;
+	
+	// Service 模型实例
+	protected $service;
+	// 设置允许与不允许方法 shizq 2019-12-05
+	protected $allowActions = [];
+	protected $notAllowActions = [];
+	
+	public function beforeAction($action)
+	{
+		//token验证
+		//$adminId = jwt::getLoginId();
+		$adminId = 1;
+		if (empty($adminId)) {
+			$this->validate = false;
+		}
+		
+		//方法开放设置 shizq 2019-12-05
+		if (in_array($action->id, $this->notAllowActions)) {
+			util::fail($action->id . ' not allow');
+		}
+		
+		//游客可以访问的方法
+		if (in_array($action->id, $this->withoutLogin)) {
+			$this->validate = true;
+		}
+		if ($this->validate == false) {
+			util::notLogin();
+		}
+		$admin = AdminService::getById($adminId);
+		if (empty($admin)) {
+			util::fail('没有找到管理员');
+		}
+		$merchantId = $admin['merchantId'];
+		if (empty($merchantId)) {
+			util::fail('没有找到商家信息');
+		}
+		$merchant = MerchantService::getById($merchantId);
+		$merchantExtend = MerchantExtendService::getByMerchantId($merchantId);
+		$merchantAsset = MerchantAssetService::getByMerchantId($merchantId);
+		Yii::$app->params['adminId'] = $adminId;
+		Yii::$app->params['admin'] = $admin;
+		Yii::$app->params['merchantId'] = $merchantId;
+		Yii::$app->params['merchant'] = $merchant;
+		Yii::$app->params['merchant'] = $merchant;
+		Yii::$app->params['merchantAsset'] = $merchantAsset;
+		Yii::$app->params['merchantExtend'] = $merchantExtend;
+		$this->adminId = $adminId;
+		$this->merchantId = $merchantId;
+		$this->merchant = $merchant;
+		$this->merchantExtend = $merchantExtend;
+		$this->merchantAsset = $merchantAsset;
+		return parent::beforeAction($action);
+	}
+	
+	public function actionList()
+	{
+		$numargs = func_num_args();
+		$select = $numargs >= 1 ? func_get_arg(0) : '*';
+		$where = $numargs >= 2 ? func_get_arg(1) : null;
+		$order = $numargs >= 3 ? func_get_arg(2) : '';
+		$with = $numargs >= 4 ? func_get_arg(3) : '';
+		
+		$service = $this->service;
+		$list = $service::getList($select, $where, $order, $with);
+		util::success($list);
+	}
+	
+	public function actionAdd()
+	{
+		$data = Yii::$app->request->post();
+		$service = $this->service;
+		$re = $service::add($data);
+		util::success($re);
+	}
+	
+	public function actionDetail()
+	{
+		$id = Yii::$app->request->get('id');
+		$service = $this->service;
+		$data = $service::getById($id);
+		if (isset($data['merchantId']) == false || $this->merchantId != $data['merchantId']) {
+			util::fail('没有权限');
+		}
+		if (!empty($data)) {
+			util::success($data);
+		}
+		
+		util::fail('');
+	}
+	
+	public function actionUpdate()
+	{
+		$data = Yii::$app->request->post();
+		$id = $data['id'];
+		$service = $this->service;
+		$re = $service::updateById($id, $data);
+		if ($re['status'] === true) {
+			util::success($re);
+		}
+		
+		util::fail();
+	}
+	
+	public function actionDelete()
+	{
+		$id = Yii::$app->request->get('id');
+		$service = $this->service;
+		$service::deleteById($id);
+		util::success([], '删除成功');
+	}
 }
 

+ 6 - 13
app/business/controllers/OrderController.php

@@ -4,20 +4,8 @@ namespace business\controllers;
 
 use biz\order\services\OrderService;
 use Yii;
-use yii\data\Pagination;
-use yii\helpers\Json;
-use common\models\xhOrder;
-use common\models\xhOrderGoods;
 use common\components\util;
 use common\components\stringUtil;
-use common\components\weixinUtil;
-use common\services\xhOrderService;
-use common\services\xhGoodsService;
-use common\services\xhTMessageService;
-use common\services\xhUserService;
-use common\services\xhUserAlipayService;
-use common\components\page;
-use common\components\configDict;
 
 class OrderController extends BaseController
 {
@@ -44,7 +32,12 @@ class OrderController extends BaseController
 	//发货管理 shish 2019.11.30
 	public function actionSend()
 	{
-	
+
+	}
+
+	public function actionSendUpdate()
+	{
+
 	}
 	
 	//向快递公司发起配送需求

+ 0 - 13
biz/admin/classes/AdminToMerchantClass.php

@@ -1,13 +0,0 @@
-<?php
-
-namespace biz\admin\classes;
-
-use Yii;
-use biz\base\classes\BaseClass;
-
-class AdminToMerchantClass extends BaseClass
-{
-
-	public static $baseFile = '\biz\admin\models\AdminToMerchant';
-	
-}

+ 0 - 13
biz/admin/models/AdminToMerchant.php

@@ -1,13 +0,0 @@
-<?php
-namespace biz\admin\models;
-use biz\base\models\Base;
-
-class AdminToMerchant extends Base
-{
-
-	public static function tableName()
-	{
-		return 'xhAdminToMerchant';
-	}
-
-}

+ 0 - 20
biz/admin/services/AdminToMerchantService.php

@@ -1,20 +0,0 @@
-<?php
-
-namespace biz\admin\services;
-
-use biz\base\services\BaseService;
-use Yii;
-
-class AdminToMerchantService extends BaseService
-{
-	
-	public static $baseFile = '\biz\admin\classes\AdminToMerchantClass';
-
-	//获取管理员默认管理的商家 shish 2019.11.26
-	public static function getDefaultMerchant($adminId)
-	{
-		$relation = self::getByCondition(['adminId' => $adminId]);
-		return isset($relation['merchantId']) ? $relation['merchantId'] : 0;
-	}
-
-}