瀏覽代碼

培训相关表结构

shish 5 年之前
父節點
當前提交
24ab8a6d09

+ 3 - 3
common/components/configDict.php

@@ -260,10 +260,10 @@ class configDict
         'xhShop' => 'xhShop_',
         'xhWifiList' => 'xhWifiList_',
         'xhAdminOpenId' => 'xhAdminOpenId_',
-        'xhTrainClass' => 'xhTrainClass_',
-        'xhTrainCourse' => 'xhTrainCourse_',
+        'xhPxClass' => 'xhPxClass_',
+        'xhPxCourse' => 'xhPxCourse_',
         'xhTrainStudent' => 'xhTrainStudent_',
-        'xhTrainUserCourse' => 'xhTrainUserCourse_',
+        'xhPxUserCourse' => 'xhPxUserCourse_',
         'xhOrderDayNum' => 'xhOrderDayNum',
         'xhOrderMonthNum' => 'xhOrderMonthNum',
         'xhStatIncome' => 'xhStatIncome',

+ 1 - 1
common/models/xhTrainClass.php

@@ -7,7 +7,7 @@ class xhTrainClass extends xhBaseModel
 	
     public static function tableName()
     {
-        return 'xhTrainClass';
+        return 'xhPxClass';
     }
 
 }

+ 1 - 1
common/models/xhTrainCourse.php

@@ -7,7 +7,7 @@ class xhTrainCourse extends xhBaseModel
 
     public static function tableName()
     {
-        return 'xhTrainCourse';
+        return 'xhPxCourse';
     }
 
 }

+ 1 - 1
common/models/xhTrainTeacher.php

@@ -11,7 +11,7 @@ class xhTrainTeacher extends xhBaseModel
      */
     public static function tableName()
     {
-        return 'xhTrainTeacher';
+        return 'xhPxTeacher';
     }
 
 }

+ 2 - 4
common/models/xhTrainUserCourse.php

@@ -4,12 +4,10 @@ namespace common\models;
 
 class xhTrainUserCourse extends xhBaseModel
 {
-    /**
-     * @inheritdoc
-     */
+
     public static function tableName()
     {
-        return 'xhTrainUserCourse';
+        return 'xhPxUserCourse';
     }
 
 }

+ 3 - 3
common/services/xhTrainClassService.php

@@ -17,7 +17,7 @@ class xhTrainClassService {
 
 	public static function getById($id)
 	{	
-		$cacheKey		= configDict::getCacheKey('xhTrainClass').$id;
+		$cacheKey		= configDict::getCacheKey('xhPxClass').$id;
 		$class			= Yii::$app->redis->executeCommand('HGETALL', [$cacheKey]);
 		if(!empty($class)){
 			$arr		= [];
@@ -63,7 +63,7 @@ class xhTrainClassService {
 
 	public static function refreshById($id)
 	{
-		$classKey		= configDict::getCacheKey('xhTrainClass').$id;
+		$classKey		= configDict::getCacheKey('xhPxClass').$id;
 		Yii::$app->redis->executeCommand('DEL', [$classKey]);
 		self::getById($id);
 	}
@@ -71,7 +71,7 @@ class xhTrainClassService {
 	public static function updateById($id,$data)
 	{
 		xhTrainClass::updateById($id, $data);
-		$classKey			= configDict::getCacheKey('xhTrainClass').$id;
+		$classKey			= configDict::getCacheKey('xhPxClass').$id;
 		$classParams		= [$classKey];
 		foreach($data as $key => $val){
 			$classParams[]	= $key;

+ 3 - 3
common/services/xhTrainCourseService.php

@@ -17,7 +17,7 @@ class xhTrainCourseService {
 
 	public static function getById($id)
 	{	
-		$cacheKey		= configDict::getCacheKey('xhTrainCourse').$id;
+		$cacheKey		= configDict::getCacheKey('xhPxCourse').$id;
 		$course			= Yii::$app->redis->executeCommand('HGETALL', [$cacheKey]);
 		if(!empty($course)){
 			$arr		= [];
@@ -63,7 +63,7 @@ class xhTrainCourseService {
 
 	public static function refreshById($id)
 	{
-		$courseKey		= configDict::getCacheKey('xhTrainCourse').$id;
+		$courseKey		= configDict::getCacheKey('xhPxCourse').$id;
 		Yii::$app->redis->executeCommand('DEL', [$courseKey]);
 		self::getById($id);
 	}
@@ -72,7 +72,7 @@ class xhTrainCourseService {
 	{
 		xhTrainCourse::updateById($id, $data);
 		self::getById($id);
-		$courseKey			= configDict::getCacheKey('xhTrainCourse').$id;
+		$courseKey			= configDict::getCacheKey('xhPxCourse').$id;
 		$courseParams		= [$courseKey];
 		foreach($data as $key => $val){
 			$courseParams[]	= $key;

+ 3 - 3
common/services/xhTrainUserCourseService.php

@@ -15,7 +15,7 @@ class xhTrainUserCourseService {
 
 	public static function getById($id)
 	{	
-		$cacheKey		= configDict::getCacheKey('xhTrainUserCourse').$id;
+		$cacheKey		= configDict::getCacheKey('xhPxUserCourse').$id;
 		$course			= Yii::$app->redis->executeCommand('HGETALL', [$cacheKey]);
 		if(!empty($course)){
 			$arr		= [];
@@ -61,7 +61,7 @@ class xhTrainUserCourseService {
 
 	public static function refreshById($id)
 	{
-		$courseKey		= configDict::getCacheKey('xhTrainUserCourse').$id;
+		$courseKey		= configDict::getCacheKey('xhPxUserCourse').$id;
 		Yii::$app->redis->executeCommand('DEL', [$courseKey]);
 		self::getById($id);
 	}
@@ -70,7 +70,7 @@ class xhTrainUserCourseService {
 	{
 		xhTrainUserCourse::updateById($id, $data);
 		self::getById($id);//保存有缓存
-		$courseKey			= configDict::getCacheKey('xhTrainUserCourse').$id;
+		$courseKey			= configDict::getCacheKey('xhPxUserCourse').$id;
 		$courseParams		= [$courseKey];
 		foreach($data as $key => $val){
 			$courseParams[]	= $key;

+ 19 - 1
sql.sql

@@ -1373,4 +1373,22 @@ ALTER TABLE xhGhsOrder MODIFY `status` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '
 ALTER TABLE `xhOrder` MODIFY `status` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '订单状态 1待付款 2待配送 3配送中 4已完成 5已取消 6已退款';
 ALTER TABLE xhOrderSend ADD orderSn CHAR(20) NOT NULL DEFAULT '' COMMENT '订单编号' AFTER `id`;
 
-确认国兰全部订单已经配送完成后 请将国兰订单全部置为已完成或已取消状态 其中付款的已完成 未付款的已取消
+确认国兰全部订单已经配送完成后 请将国兰订单全部置为已完成或已取消状态 其中付款的已完成 未付款的已取消
+
+========
+== shish 2021-3-5
+ALTER TABLE `xhTrainClass` DROP COLUMN `createTime`;
+ALTER TABLE `xhTrainClass` DROP COLUMN `addTime`;
+ALTER TABLE `xhTrainClass` DROP COLUMN `modTime`;
+ALTER TABLE `xhTrainClass` ADD `addTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间' AFTER `sort`;
+ALTER TABLE `xhTrainClass` CHANGE `sort` `inTrun` INT(11) NOT NULL DEFAULT '0' COMMENT '排序';
+ALTER TABLE `xhTrainClass` CHANGE `merchantId` `sjId` INT NOT NULL DEFAULT 0 COMMENT '商家id';
+ALTER TABLE `xhTrainCourse` CHANGE `merchantId` `sjId` INT NOT NULL DEFAULT 0 COMMENT '商家id';
+DROP TABLE IF EXISTS `xhTrainCoursePraise`;
+ALTER TABLE `xhTrainTeacher` DROP COLUMN `addTime`;
+ALTER TABLE `xhTrainTeacher` DROP COLUMN `modTime`;
+ALTER TABLE `xhTrainTeacher` CHANGE `createTime` `addTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间';
+ALTER TABLE xhTrainUserCourse RENAME TO xhPxUserCourse;
+ALTER TABLE xhTrainTeacher RENAME TO xhPxTeacher;
+ALTER TABLE xhTrainCourse RENAME TO xhPxCourse;
+ALTER TABLE xhTrainClass RENAME TO xhPxClass;