shish 6 жил өмнө
parent
commit
d943a02300

+ 22 - 34
app/admin/controllers/UserController.php

@@ -2,45 +2,18 @@
 
 namespace admin\controllers;
 
-use biz\user\services\UserOldDataService;
+use biz\admin\services\AdminService;
 use biz\user\services\UserService;
-use common\models\xhAdmin;
-use common\models\xhStudent;
 use Yii;
-use common\models\xhUserAlipay;
-use common\models\xhUserTag;
-use common\models\xhTrainCourse;
-use common\models\xhUser;
-use common\models\xhUserAsset;
-use common\models\xhTrainUserCourse;
-use common\services\xhUserAlipayService;
-use common\services\xhUserIntegralService;
-use common\services\xhTrainClassService;
-use common\services\xhOrderService;
-use common\services\xhPayToolService;
-use common\services\xhRechargeService;
-use common\services\xhMerchantExtendService;
-use common\services\xhMerchantAssetService;
-use common\services\xhUserAssetService;
-use common\services\xhCouponService;
-use common\services\xhUserTagService;
-use common\services\xhUserTagClassService;
-use common\services\xhAdminService;
-use common\services\xhMerchantService;
 use common\components\stringUtil;
-use common\components\weixinUtil;
-use common\components\configDict;
 use common\components\util;
-use common\components\page;
-use common\services\xhUserService;
-use common\services\xhUserByDayService;
-use common\services\xhUserUniteService;
-use common\services\xhMerchantCapitalService;
-use common\services\xhTMessageService;
 
 class UserController extends BaseController
 {
 	
+	public $enableCsrfValidation = false;
+	
+	//客户列表 shish 2019.11.30
 	public function actionGetList()
 	{
 		$get = Yii::$app->request->get();
@@ -70,7 +43,7 @@ class UserController extends BaseController
 		$list = UserService::getUserList($where);
 		util::success($list);
 	}
-
+	
 	//获取客户基本和资产信息 shish 2019.11.30
 	public function actionGetInfo()
 	{
@@ -81,7 +54,7 @@ class UserController extends BaseController
 		}
 		util::success($info);
 	}
-
+	
 	//获取客户基本、资产和订单完整信息 2019.11.30
 	public function actionGetFullInfo()
 	{
@@ -92,5 +65,20 @@ class UserController extends BaseController
 		}
 		util::success($info);
 	}
-
+	
+	//添加客户,申请会员时会自动同步资产 shish 2019.11.30
+	public function actionAdd()
+	{
+		$post = Yii::$app->request->post();
+		if ($post['mobile'] != $post['confirmMobile']) {
+			util::fail('二次输入手机号不一样');
+		}
+		$confirmPassword = isset($post['confirmPassword']) ? $post['confirmPassword'] : '';
+		$verify = AdminService::verifyConfirmPassword($this->adminId, $confirmPassword);
+		if ($verify == false) {
+			util::fail('密码错误');
+		}
+		
+	}
+	
 }

+ 16 - 5
biz/admin/services/AdminService.php

@@ -2,6 +2,7 @@
 
 namespace biz\admin\services;
 
+use biz\admin\classes\AdminClass;
 use biz\auth\services\AuthService;
 use biz\base\services\BaseService;
 use biz\merchant\services\MerchantService;
@@ -20,6 +21,16 @@ class AdminService extends BaseService
 		return 'SID_HT_' . $account . '_' . date("mdHis") . '_' . stringUtil::charsShuffle(18);
 	}
 	
+	public static function verifyConfirmPassword($adminId, $password)
+	{
+		$admin = AdminClass::getById($adminId);
+		$hash = isset($admin['confirmPassword']) ? $admin['confirmPassword'] : '';
+		if (password_verify($password, $hash)) {
+			return true;
+		}
+		return false;
+	}
+	
 	//发送到手机上 shish 2019.8.11
 	public static function sendUrlToMobile($url, $merchant)
 	{
@@ -43,7 +54,7 @@ class AdminService extends BaseService
 		$admin = self::getById($adminId);
 		$roleId = isset($admin['roleId']) ? $admin['roleId'] : 0;
 		if (empty($roleId)) {
-			return [['endId' => 1,'endName'=>'零售', 'frontUrl' => [], 'backUrl' => []]];
+			return [['endId' => 1, 'endName' => '零售', 'frontUrl' => [], 'backUrl' => []]];
 		}
 		//零售端
 		$endId = 1;
@@ -51,13 +62,13 @@ class AdminService extends BaseService
 		//商家在业务端的权限
 		$merchantIdList = MerchantService::getAuthIdList($merchantId, $endId);
 		if (empty($merchantIdList)) {
-			return [['endId' => 1,'endName'=>'零售', 'frontUrl' => [], 'backUrl' => []]];
+			return [['endId' => 1, 'endName' => '零售', 'frontUrl' => [], 'backUrl' => []]];
 		}
 		
 		//角色在业务端的权限
 		$roleIdList = AdminRoleAuthService::getAuthIdList($roleId, $endId);
 		if (empty($roleIdList)) {
-			return [['endId' => 1,'endName'=>'零售', 'front' => [], 'back' => []]];
+			return [['endId' => 1, 'endName' => '零售', 'front' => [], 'back' => []]];
 		}
 		$commonIdList = in_array('*', $roleIdList) ? $merchantIdList : array_intersect($roleIdList, $merchantIdList);
 		
@@ -65,7 +76,7 @@ class AdminService extends BaseService
 		
 		$front = array_column($all, 'frontUrl');
 		$back = array_column($all, 'backUrl');
-		return [['endId' => 1,'endName'=>'零售', 'frontUrl' => $front, 'backUrl' => []]];
+		return [['endId' => 1, 'endName' => '零售', 'frontUrl' => $front, 'backUrl' => []]];
 	}
-
+	
 }

+ 2 - 0
sql.txt

@@ -7,6 +7,8 @@ DROP TABLE IF EXISTS `xhGoodsUsage`;
 ALTER TABLE xhOrder ADD INDEX merchant(merchantId,`status`);
 ALTER TABLE xhOrder ADD INDEX userId(userId,`status`);
 ALTER TABLE xhUserAsset ADD inviteNum INT NOT NULL DEFAULT 0 COMMENT '邀请新人数量' AFTER `discount`;
+ALTER TABLE xhAdmin MODIFY `password` VARCHAR(500) NOT NULL DEFAULT '' COMMENT '密码';
+ALTER TABLE xhAdmin MODIFY `confirmPassword` VARCHAR(500) NOT NULL DEFAULT '' COMMENT '确认密码';
 
 shish 2019.11.27
 ALTER TABLE xhOrder ADD refund TINYINT NOT NULL DEFAULT 0 COMMENT '1已退款 0正常订单,没有退款' AFTER luckyNum;

+ 1 - 1
开发规范.md

@@ -29,7 +29,7 @@ service和class层都有以下通用方法可以使用
 ::getCount($condition)
 
 ::getList()
-::getListData()
+::getLimitList()
 ::getAllList()
 condition支持查询条件包括
 'name'=>'john'