Parcourir la source

已经导入的老客户判断

shish il y a 6 ans
Parent
commit
9559c03b99

+ 2 - 0
biz/goods/classes/CategoryClass.php

@@ -12,6 +12,8 @@ class CategoryClass extends BaseClass
 	
 	public static $baseFile = '\biz\goods\models\Category';
 	
+	//可以使用的分类:花束 花盒 蝴蝶兰 花篮 植物 永生花 散花 充值卡 花艺课 花礼 瓶器
+	
 	//取出商家所有的分类 shish 2019.12.7
 	public static function getCategoryIdList($merchantId)
 	{

+ 9 - 3
console/controllers/UpgradeController.php

@@ -906,6 +906,12 @@ ALTER TABLE `xhMerchantCapital` MODIFY `io` TINYINT NOT NULL DEFAULT 0 COMMENT '
 		$oldUserList = Yii::$app->db2->createCommand('select * from xhUserOldData where `status`=0')->queryAll();
 		if (!empty($oldUserList)) {
 			foreach ($oldUserList as $user) {
+				$mobile = $user['mobile'];
+				$exists = UserService::getByCondition(['mobile' => $mobile, 'merchantId' => 12358]);
+				if (!emtpy($exists)) {
+					echo "老客户:'.$mobile.'已经导入过了。\n";
+					continue;
+				}
 				$user['realName'] = $user['userName'];
 				$user['growth'] = $user['integral'];
 				$insertUser = UserService::addUser($user);
@@ -975,12 +981,12 @@ ALTER TABLE `xhMerchantCapital` MODIFY `io` TINYINT NOT NULL DEFAULT 0 COMMENT '
 				}
 			}
 		}
-
+		
 		$sql = "ALTER TABLE xhGoods ADD `briefContent` VARCHAR(1000) NOT NULL DEFAULT '' COMMENT '简单内容介绍,移动端添加商品' AFTER `content`;";
 		Yii::$app->db->createCommand($sql)->execute();
-
+		
 	}
-
+	
 	//重新拉取并保存国兰客户的头像和图片 shish 2020.1.12
 	public function actionSyncAvatar()
 	{