贴个代码~~~
准备添加的字段信息:
- 商品信息
- 50 介质media
- 20 主演star
- 20 作者author
- 20 导演director
- 20 语言language
- 20 字幕title
- 30 出版号 isrc
- 20 产地madein
- 120 版权提供 provide
- 30 版权号provideno
- 30 引进号importno
- 120 出版publish
-
复制代码
修改结构
- ALTER TABLE `前缀_goods`
- ADD `media` varchar(50) NOT NULL default '',
- ADD `star` varchar(20) NOT NULL default '',
- ADD `author` varchar(20) NOT NULL default '',
- ADD `director` varchar(20) NOT NULL default '',
- ADD `language` varchar(20) NOT NULL default '',
- ADD `title` varchar(20) NOT NULL default '',
- ADD `isrc` varchar(30) NOT NULL default '',
- ADD `madein` varchar(20) NOT NULL default '',
- ADD `provide` varchar(120) NOT NULL default '',
- ADD `provideno` varchar(30) NOT NULL default '',
- ADD `importno` varchar(30) NOT NULL default '',
- ADD `publish` varchar(120) NOT NULL default '';
复制代码
goods_info.htm注释中是添加的
- <!-- start goods form -->
- <div class="tab-div">
- <!-- tab bar -->
- <div id="tabbar-div">
- <p>
- <span class="tab-front" id="general-tab">{$lang.tab_general}</span>
- <!-- modify by xsy -->
- <span class="tab-back" id="goodsinfo-tab">{$lang.tab_goodsinfo}</span>
- <span
- class="tab-back" id="detail-tab">{$lang.tab_detail}</span><span
- class="tab-back" id="mix-tab">{$lang.tab_mix}</span>{if $goods_type_list}<span
- class="tab-back" id="properties-tab">{$lang.tab_properties}</span>{/if}<span
- class="tab-back" id="gallery-tab">{$lang.tab_gallery}</span><span
- class="tab-back" id="linkgoods-tab">{$lang.tab_linkgoods}</span><span
- class="tab-back" id="groupgoods-tab">{$lang.tab_groupgoods}</span><span
- class="tab-back" id="article-tab">{$lang.tab_article}</span>
- </p>
- </div>
复制代码
- <!-- 商品信息 modify by xsy -->
- <table width="90%" id="goodsinfo-table" style="display:none">
- <td class="label">{$lang.lab_media}</td>
- <td><input type="text" name="media" value="{$goods.media}" size="10" /></td>
- </tr>
- <tr>
- <td class="label">{$lang.lab_star}</td>
- <td><input type="text" name="star" value="{$goods.star}" size="15" /></td>
- </tr>
- <tr>
- <td class="label">{$lang.lab_author}</td>
- <td><input type="text" name="author" value="{$goods.author}" size="15" /></td>
- </tr>
- <tr>
- <td class="label">{$lang.lab_director}</td>
- <td><input type="text" name="director" value="{$goods.director}" size="20" /></td>
- </tr>
- <tr>
- <td class="label">{$lang.lab_language}</td>
- <td><input type="text" name="language" value="{$goods.language}" size="15" /></td>
- </tr>
- <tr>
- <td class="label">{$lang.lab_title}</td>
- <td><input type="text" name="title" value="{$goods.title|escape}" size="15" /></td>
- </tr>
- <tr>
- <td class="label">{$lang.lab_isrc}</td>
- <td><input type="text" name="isrc" value="{$goods.isrc|escape}" size="20" /></td>
- </tr>
- <tr>
- <td class="label">{$lang.lab_madein}</td>
- <td><input type="text" name="madein" value="{$goods.madein|escape}" size="15" /></td>
- </tr>
- <tr>
- <td class="label">{$lang.lab_provide}</td>
- <td><input type="text" name="provide" value="{$goods.provide|escape}" size="15" /></td>
- </tr>
- <tr>
- <td class="label">{$lang.lab_provideno}</td>
- <td><input type="text" name="provideno" value="{$goods.provideno|escape}" size="15" /></td>
- </tr>
- <tr>
- <td class="label">{$lang.lab_importno}</td>
- <td><input type="text" name="importno" value="{$goods.importno|escape}" size="15" /></td>
- </tr>
- <tr>
- <td class="label">{$lang.lab_publish}</td>
- <td><input type="text" name="publish" value="{$goods.publish|escape}" size="20" /></td>
- </tr>
- </table>
复制代码
相关语言 goods.php
- /* 附加商品信息 modify by xsy */
- $_LANG['tab_goodsinfo'] = '商品信息';
- $_LANG['lab_media'] = '介质:';
- $_LANG['lab_star'] = '主演:';
- $_LANG['lab_author'] = '作者:';
- $_LANG['lab_director'] = '导演:';
- $_LANG['lab_language'] = '语言:';
- $_LANG['lab_title'] = '字幕:';
- $_LANG['lab_isrc'] = '出版号:';
- $_LANG['lab_madein'] = '产地:';
- $_LANG['lab_provide'] = '版权提供:';
- $_LANG['lab_provideno'] = '版权号:';
- $_LANG['lab_importno'] = '引进号:';
- $_LANG['lab_publish'] = '出版:';
复制代码
主要代码修改
- /* 入库 */
- if ($is_insert)
- {
- // modify by xsy
- $sql = "INSERT INTO " . $ecs->table('goods') . " (goods_name, goods_sn, " .
- "cat_id, brand_id, shop_price, market_price, is_promote, promote_price, " .
- "promote_start, promote_end, goods_img, goods_thumb, original_img, keywords, goods_brief, seller_note, " .
- "goods_weight, goods_number, warn_number, integral, is_best, is_new, is_hot, " .
- "is_on_sale, is_alone_sale, can_handsel, goods_desc, add_time, last_update, goods_type, cycle_img, ".
- "media, star, author, director, language, title, isrc, madein, provide, importno, publish)" .
- "VALUES ('$_POST[goods_name]', '$goods_sn', '$_POST[cat_id]', " .
- "'$_POST[brand_id]', '$shop_price', '$market_price', '$is_promote','$promote_price', ".
- "'$promote_start', '$promote_end', '$goods_img', '$goods_thumb', '$original_img', '$_POST[keywords]', ".
- "'$_POST[goods_brief]', '$_POST[seller_note]', '$goods_weight', '$goods_number', '$warn_number', '$_POST[integral]', ".
- "'$is_best', '$is_new', '$is_hot', '$is_on_sale', '$is_alone_sale', '$can_handsel', ".
- "'$_POST[goods_desc]', '" . time() . "', '". time() ."', '$goods_type', '$cycle_img', ".
- "'$goods_media','$goods_star','$goods_author','$goods_directory','$goods_language','$goods_title','$goods_isrc', ".
- "'$goods_provide','$goods_importno','$goods_publish')";
- }
- else
- {
- $sql = "UPDATE " . $ecs->table('goods') . " SET " .
- "goods_name = '$_POST[goods_name]', " .
- "goods_sn = '$goods_sn', " .
- "cat_id = '$_POST[cat_id]', " .
- "brand_id = '$_POST[brand_id]', " .
- "shop_price = '$shop_price', " .
- "market_price = '$market_price', " .
- "is_promote = '$is_promote', " .
- "promote_price = '$promote_price', " .
- "promote_start = '$promote_start', " .
- "promote_end = '$promote_end', ";
- if ($goods_img)
- {
- $sql .= "goods_img = '$goods_img', original_img = '$original_img', ";
- }
- if ($goods_thumb)
- {
- $sql .= "goods_thumb = '$goods_thumb', ";
- }
- // modify by xsy
- $sql .= "keywords = '$_POST[keywords]', " .
- "goods_brief = '$_POST[goods_brief]', " .
- "seller_note = '$_POST[seller_note]', " .
- "goods_weight = '$goods_weight'," .
- "goods_number = '$goods_number', " .
- "warn_number = '$warn_number', " .
- "integral = '$_POST[integral]', " .
- "is_best = '$is_best', " .
- "is_new = '$is_new', " .
- "is_hot = '$is_hot', " .
- "is_on_sale = '$is_on_sale', " .
- "is_alone_sale = '$is_alone_sale', " .
- "can_handsel = '$can_handsel', " .
- "goods_desc = '$_POST[goods_desc]', " .
- "last_update = '". time() ."', ".
- "goods_type = '$goods_type', " .
- "cycle_img = '$cycle_img' ," .
- "media = '$goods_media' ," .
- "star = '$goods_star' ," .
- "author = '$goods_author' ," .
- "director = '$goods_director' ," .
- "language = '$goods_language' ," .
- "title = '$goods_title' ," .
- "isrc = '$isrc' ," .
- "madein = '$madein' ," .
- "provide = '$provide' ," .
- "provideno = '$provideno' ," .
- "importno = '$importno' ," .
- "publish = '$publish' " .
- "WHERE goods_id = '$_REQUEST[goods_id]' LIMIT 1";
- }
复制代码
修改后的效果:
|