shish 6 жил өмнө
parent
commit
20971007fc

+ 4 - 3
console/controllers/InitController.php

@@ -271,6 +271,7 @@ TRUNCATE xhUserByDay;";
 	
 	/**
 	 * 初始化 花卉宝 的行政区划
+	 * ./yii init/district
 	 */
 	public function actionDistrict()
 	{
@@ -292,7 +293,7 @@ TRUNCATE xhUserByDay;";
 				$fullname = $oneVal['fullname'];
 				$lat = (string)$oneVal['location']['lat'];
 				$lng = (string)$oneVal['location']['lng'];
-				$oneData = ['districtId' => $topId, 'shortName' => $name, 'fullName' => $fullname, 'locationLat' => $lat, 'locationLng' => $lng, 'parentId' => 0];
+				$oneData = ['districtId' => $topId, 'name' => $name, 'fullName' => $fullname, 'locationLat' => $lat, 'locationLng' => $lng, 'parentId' => 0];
 				echo "<p>1级菜单:</p>\n";
 				print_r($oneData);
 				echo "\n";
@@ -308,7 +309,7 @@ TRUNCATE xhUserByDay;";
 							$fullname = $twoVal['fullname'];
 							$lat = (string)$twoVal['location']['lat'];
 							$lng = (string)$twoVal['location']['lng'];
-							$twoData = ['districtId' => $id, 'shortName' => $name, 'fullName' => $fullname, 'locationLat' => $lat, 'locationLng' => $lng, 'parentId' => $oneObj['id']];
+							$twoData = ['districtId' => $id, 'name' => $name, 'fullName' => $fullname, 'locationLat' => $lat, 'locationLng' => $lng, 'parentId' => $oneObj['id']];
 							echo $xx;
 							print_r($twoData);
 							echo "\n";
@@ -324,7 +325,7 @@ TRUNCATE xhUserByDay;";
 										$fullname = $threeVal['fullname'];
 										$lat = (string)$threeVal['location']['lat'];
 										$lng = (string)$threeVal['location']['lng'];
-										$threeData = ['districtId' => $id, 'shortName' => $name, 'fullName' => $fullname, 'locationLat' => $lat, 'locationLng' => $lng, 'parentId' => $twoObj['id']];
+										$threeData = ['districtId' => $id, 'name' => $name, 'fullName' => $fullname, 'locationLat' => $lat, 'locationLng' => $lng, 'parentId' => $twoObj['id']];
 										$threeObj = xhDistrict::add($threeData);
 										echo $incr;
 										print_r($threeData);

+ 5 - 1
console/controllers/UpgradeController.php

@@ -865,7 +865,11 @@ CREATE TABLE `xhInformUser` (
   PRIMARY KEY (`id`)
 ) COMMENT='客户消息通知记录';";
 		Yii::$app->db->createCommand($sql)->execute();
-		
+
+		//省市区表字段变更
+		$sql = "ALTER TABLE `xhDistrict` CHANGE `shortName` `name` VARCHAR(20) NOT NULL DEFAULT '' COMMENT '简称';";
+		Yii::$app->db->createCommand($sql)->execute();
+
 		//统计相关
 		//xhStatIncomeMonth
 		$list = StatIncomeMonthService::getAllByCondition([], null, '*');