Browse Source

chore: 数据库中goods表的desc字段调整成detail,因为desc是数据库关键字

Junling Bu 7 years ago
parent
commit
550005869b

+ 1 - 1
litemall-admin/src/views/goods/create.vue

@@ -81,7 +81,7 @@
         </el-form-item> 
             
         <el-form-item label="商品详细介绍">
-          <editor :init="editorInit" v-model="goods.desc"></editor>
+          <editor :init="editorInit" v-model="goods.detail"></editor>
         </el-form-item>    
     </el-form>
   </el-card>

+ 1 - 1
litemall-admin/src/views/goods/edit.vue

@@ -81,7 +81,7 @@
         </el-form-item> 
             
         <el-form-item label="商品详细介绍">
-          <editor :init="editorInit" v-model="goods.desc"></editor>
+          <editor :init="editorInit" v-model="goods.detail"></editor>
         </el-form-item>    
     </el-form>
   </el-card>

+ 10 - 10
litemall-admin/src/views/goods/list.vue

@@ -52,12 +52,12 @@
         </template>
       </el-table-column>
 
-      <el-table-column align="center" label="详情" prop="desc">
+      <el-table-column align="center" label="详情" prop="detail">
         <template slot-scope="scope">
-          <el-dialog title="商品详情" :visible.sync="descDialogVisible">
-            <div v-html="descDetail"></div>
+          <el-dialog title="商品详情" :visible.sync="detailDialogVisible">
+            <div v-html="goodsDetail"></div>
           </el-dialog>
-          <el-button type="primary" size="mini" @click="showDesc(scope.row.desc)">查看</el-button>
+          <el-button type="primary" size="mini" @click="showDetail(scope.row.detail)">查看</el-button>
         </template>
       </el-table-column>
 
@@ -145,8 +145,8 @@ export default {
         sort: 'add_time',
         order: 'desc'
       },
-      descDetail: '',
-      descDialogVisible: false,
+      goodsDetail: '',
+      detailDialogVisible: false,
       downloadLoading: false
     }
   },
@@ -184,9 +184,9 @@ export default {
     handleUpdate(row) {
       this.$router.push({ path: '/goods/edit', query: { id: row.id }})
     },
-    showDesc(desc) {
-      this.descDetail = desc
-      this.descDialogVisible = true
+    showDetail(detail) {
+      this.goodsDetail = detail
+      this.detailDialogVisible = true
     },
     handleDelete(row) {
       deleteGoods(row).then(response => {
@@ -204,7 +204,7 @@ export default {
       this.downloadLoading = true
       import('@/vendor/Export2Excel').then(excel => {
         const tHeader = ['商品ID', '商品编号', '名称', '专柜价格', '当前价格', '是否新品', '是否热品', '是否在售', '首页主图', '宣传图片列表', '商品介绍', '详细介绍', '商品图片', '商品单位', '关键字', '类目ID', '品牌商ID']
-        const filterVal = ['id', 'goodsSn', 'name', 'counterPrice', 'retailPrice', 'isNew', 'isHot', 'isOnSale', 'listPicUrl', 'gallery', 'brief', 'desc', 'picUrl', 'goodsUnit', 'keywords', 'categoryId', 'brandId']
+        const filterVal = ['id', 'goodsSn', 'name', 'counterPrice', 'retailPrice', 'isNew', 'isHot', 'isOnSale', 'listPicUrl', 'gallery', 'brief', 'detail', 'picUrl', 'goodsUnit', 'keywords', 'categoryId', 'brandId']
         excel.export_json_to_excel2(tHeader, this.list, filterVal, '商品信息')
         this.downloadLoading = false
       })

+ 14 - 14
litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallGoods.java

@@ -189,11 +189,11 @@ public class LitemallGoods {
     /**
      *
      * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column litemall_goods.desc
+     * This field corresponds to the database column litemall_goods.detail
      *
      * @mbg.generated
      */
-    private String desc;
+    private String detail;
 
     /**
      * This method was generated by MyBatis Generator.
@@ -629,26 +629,26 @@ public class LitemallGoods {
 
     /**
      * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column litemall_goods.desc
+     * This method returns the value of the database column litemall_goods.detail
      *
-     * @return the value of litemall_goods.desc
+     * @return the value of litemall_goods.detail
      *
      * @mbg.generated
      */
-    public String getDesc() {
-        return desc;
+    public String getDetail() {
+        return detail;
     }
 
     /**
      * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column litemall_goods.desc
+     * This method sets the value of the database column litemall_goods.detail
      *
-     * @param desc the value for litemall_goods.desc
+     * @param detail the value for litemall_goods.detail
      *
      * @mbg.generated
      */
-    public void setDesc(String desc) {
-        this.desc = desc;
+    public void setDetail(String detail) {
+        this.detail = detail;
     }
 
     /**
@@ -681,7 +681,7 @@ public class LitemallGoods {
         sb.append(", retailPrice=").append(retailPrice);
         sb.append(", addTime=").append(addTime);
         sb.append(", deleted=").append(deleted);
-        sb.append(", desc=").append(desc);
+        sb.append(", detail=").append(detail);
         sb.append("]");
         return sb.toString();
     }
@@ -722,7 +722,7 @@ public class LitemallGoods {
             && (this.getRetailPrice() == null ? other.getRetailPrice() == null : this.getRetailPrice().equals(other.getRetailPrice()))
             && (this.getAddTime() == null ? other.getAddTime() == null : this.getAddTime().equals(other.getAddTime()))
             && (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()))
-            && (this.getDesc() == null ? other.getDesc() == null : this.getDesc().equals(other.getDesc()));
+            && (this.getDetail() == null ? other.getDetail() == null : this.getDetail().equals(other.getDetail()));
     }
 
     /**
@@ -753,7 +753,7 @@ public class LitemallGoods {
         result = prime * result + ((getRetailPrice() == null) ? 0 : getRetailPrice().hashCode());
         result = prime * result + ((getAddTime() == null) ? 0 : getAddTime().hashCode());
         result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
-        result = prime * result + ((getDesc() == null) ? 0 : getDesc().hashCode());
+        result = prime * result + ((getDetail() == null) ? 0 : getDetail().hashCode());
         return result;
     }
 
@@ -794,7 +794,7 @@ public class LitemallGoods {
         retailPrice("retail_price", "retailPrice", "DECIMAL"),
         addTime("add_time", "addTime", "TIMESTAMP"),
         deleted("deleted", "deleted", "BIT"),
-        desc("desc", "desc", "LONGVARCHAR");
+        detail("detail", "detail", "LONGVARCHAR");
 
         /**
          * This field was generated by MyBatis Generator.

+ 17 - 17
litemall-db/src/main/resources/org/linlinjava/litemall/db/dao/LitemallGoodsMapper.xml

@@ -30,7 +30,7 @@
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
     -->
-    <result column="desc" jdbcType="LONGVARCHAR" property="desc" />
+    <result column="detail" jdbcType="LONGVARCHAR" property="detail" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <!--
@@ -150,7 +150,7 @@
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
     -->
-    `desc`
+    detail
   </sql>
   <select id="selectByExampleWithBLOBs" parameterType="org.linlinjava.litemall.db.domain.LitemallGoodsExample" resultMap="ResultMapWithBLOBs">
     <!--
@@ -209,7 +209,7 @@
       <otherwise>
         id, goods_sn, `name`, category_id, brand_id, gallery, keywords, brief, is_on_sale, 
           sort_order, pic_url, is_new, is_hot, unit, counter_price, retail_price, add_time, 
-          deleted, `desc`
+          deleted, detail
       </otherwise>
     </choose>
     from litemall_goods
@@ -274,7 +274,7 @@
       <otherwise>
         id, goods_sn, `name`, category_id, brand_id, gallery, keywords, brief, is_on_sale, 
           sort_order, pic_url, is_new, is_hot, unit, counter_price, retail_price, add_time, 
-          deleted, `desc`
+          deleted, detail
       </otherwise>
     </choose>
     from litemall_goods
@@ -312,14 +312,14 @@
       sort_order, pic_url, is_new, 
       is_hot, unit, counter_price, 
       retail_price, add_time, deleted, 
-      `desc`)
+      detail)
     values (#{goodsSn,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{categoryId,jdbcType=INTEGER}, 
       #{brandId,jdbcType=INTEGER}, #{gallery,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler}, 
       #{keywords,jdbcType=VARCHAR}, #{brief,jdbcType=VARCHAR}, #{isOnSale,jdbcType=BIT}, 
       #{sortOrder,jdbcType=SMALLINT}, #{picUrl,jdbcType=VARCHAR}, #{isNew,jdbcType=BIT}, 
       #{isHot,jdbcType=BIT}, #{unit,jdbcType=VARCHAR}, #{counterPrice,jdbcType=DECIMAL}, 
       #{retailPrice,jdbcType=DECIMAL}, #{addTime,jdbcType=TIMESTAMP}, #{deleted,jdbcType=BIT}, 
-      #{desc,jdbcType=LONGVARCHAR})
+      #{detail,jdbcType=LONGVARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="org.linlinjava.litemall.db.domain.LitemallGoods">
     <!--
@@ -382,8 +382,8 @@
       <if test="deleted != null">
         deleted,
       </if>
-      <if test="desc != null">
-        `desc`,
+      <if test="detail != null">
+        detail,
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -438,8 +438,8 @@
       <if test="deleted != null">
         #{deleted,jdbcType=BIT},
       </if>
-      <if test="desc != null">
-        #{desc,jdbcType=LONGVARCHAR},
+      <if test="detail != null">
+        #{detail,jdbcType=LONGVARCHAR},
       </if>
     </trim>
   </insert>
@@ -514,8 +514,8 @@
       <if test="record.deleted != null">
         deleted = #{record.deleted,jdbcType=BIT},
       </if>
-      <if test="record.desc != null">
-        `desc` = #{record.desc,jdbcType=LONGVARCHAR},
+      <if test="record.detail != null">
+        detail = #{record.detail,jdbcType=LONGVARCHAR},
       </if>
     </set>
     <if test="_parameter != null">
@@ -546,7 +546,7 @@
       retail_price = #{record.retailPrice,jdbcType=DECIMAL},
       add_time = #{record.addTime,jdbcType=TIMESTAMP},
       deleted = #{record.deleted,jdbcType=BIT},
-      `desc` = #{record.desc,jdbcType=LONGVARCHAR}
+      detail = #{record.detail,jdbcType=LONGVARCHAR}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -637,8 +637,8 @@
       <if test="deleted != null">
         deleted = #{deleted,jdbcType=BIT},
       </if>
-      <if test="desc != null">
-        `desc` = #{desc,jdbcType=LONGVARCHAR},
+      <if test="detail != null">
+        detail = #{detail,jdbcType=LONGVARCHAR},
       </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
@@ -666,7 +666,7 @@
       retail_price = #{retailPrice,jdbcType=DECIMAL},
       add_time = #{addTime,jdbcType=TIMESTAMP},
       deleted = #{deleted,jdbcType=BIT},
-      `desc` = #{desc,jdbcType=LONGVARCHAR}
+      detail = #{detail,jdbcType=LONGVARCHAR}
     where id = #{id,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKey" parameterType="org.linlinjava.litemall.db.domain.LitemallGoods">
@@ -746,7 +746,7 @@
       <otherwise>
         id, goods_sn, `name`, category_id, brand_id, gallery, keywords, brief, is_on_sale, 
           sort_order, pic_url, is_new, is_hot, unit, counter_price, retail_price, add_time, 
-          deleted, `desc`
+          deleted, detail
       </otherwise>
     </choose>
     from litemall_goods

+ 1 - 1
litemall-wx/pages/goods/goods.js

@@ -85,7 +85,7 @@ Page({
      });
     }
 
-    WxParse.wxParse('goodsDetail', 'html', res.data.info.desc, that);
+    WxParse.wxParse('goodsDetail', 'html', res.data.info.detail, that);
 
     that.getGoodsRelated();
    }