shish пре 6 година
родитељ
комит
fc720b3dbd
2 измењених фајлова са 15 додато и 3 уклоњено
  1. 4 2
      biz/user/services/UserService.php
  2. 11 1
      console/controllers/UpgradeController.php

+ 4 - 2
biz/user/services/UserService.php

@@ -22,8 +22,10 @@ class UserService extends BaseService
 	public static $baseFile = '\biz\user\classes\UserClass';
 	
 	//获取客户列表 shish 2019.11.30
-	public static function getUserList($where)
+	public static function getUserList($where, $delStatus = 0)
 	{
+		//默认取没有删除的用户
+		$where['delStatus'] = $delStatus;
 		$data = UserClass::getList('*', $where, 'visitTime DESC');
 		$list = isset($data['list']) && !empty($data['list']) ? $data['list'] : [];
 		if (empty($list)) {
@@ -80,7 +82,7 @@ class UserService extends BaseService
 		}
 		return ['total' => $return['total']];
 	}
-
+	
 	//更新微信头像 shish 2020.1.12
 	public static function syncAvatar($merchantId, $nextOpenId = '')
 	{

+ 11 - 1
console/controllers/UpgradeController.php

@@ -1135,20 +1135,30 @@ update xhMerchant set merchantName='花店宝' where id=12358;update xhShop set
 			TMessageService::deleteByCondition(['merchantId' => 12358]);
 			UserService::deleteByCondition(['merchantId' => 12358]);
 			WxMenuService::deleteByCondition(['merchantId' => 12358]);
+			OrderService::deleteByCondition(['merchantId' => 12358]);
 			TMessageService::deleteByCondition(['merchantId' => 12359]);
 			UserService::deleteByCondition(['merchantId' => 12359]);
 			WxMenuService::deleteByCondition(['merchantId' => 12359]);
+			OrderService::deleteByCondition(['merchantId' => 12359]);
 		}
 		if ($env == 'test') {
 			TMessageService::deleteByCondition(['merchantId' => 12358]);
 			UserService::deleteByCondition(['merchantId' => 12358]);
 			WxMenuService::deleteByCondition(['merchantId' => 12358]);
+			OrderService::deleteByCondition(['merchantId' => 12358]);
 			TMessageService::deleteByCondition(['merchantId' => 12359]);
 			UserService::deleteByCondition(['merchantId' => 12359]);
 			WxMenuService::deleteByCondition(['merchantId' => 12359]);
+			OrderService::deleteByCondition(['merchantId' => 12359]);
 		}
+		
+		//用户删除概念的提出
+		$sql = "ALTER TABLE xhUser ADD `delStatus` TINYINT NOT NULL DEFAULT 0 COMMENT '删除状态 0未删除 1已删除' AFTER `addPrecision`;
+UPDATE xhUser SET delStatus=1 WHERE merchantId=0;";
+		Yii::$app->db->createCommand($sql)->execute($sql);
+		
 	}
-
+	
 	//数据迁移 shish 2020.1.12
 	//./yii upgrade/sync
 	public function actionSync()