



全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
目前在做自己的博客爱T-blog web开发、分享 与爱T们技术交流在商品列表页添加自定义字段(爱T-blog)1、首先要修改数据表结构,给表 ecs_goods 增加新字段:other_col,进入ECSHOP后台 数据库管理 SQL查询,输入下面SQL语句,提交。注意如果你的数据表前缀不是ecs_ 请自行修改之alter table ecs_goods add column other_col varchar(64);2. 打开admin/goods.php在/* 处理商品数据 */那里$is_hot = isset($_POSTis_hot) ? 1 : 0;(大约803行)$other_col = isset($_POSTother_col) ? 1 : 0;在 /* 入库 */添加/* 入库 */if ($is_insert)if ($code = ”)$sql = “INSERT INTO ” . $ecs-table(goods) . ” (goods_name, goods_name_style, goods_sn, ” .“cat_id, brand_id, shop_price, market_price, is_promote, promote_price, ” .“promote_start_date, promote_end_date, goods_img, goods_thumb, original_img, keywords, goods_brief, ” .“seller_note, goods_weight, goods_number, warn_number, integral, give_integral, is_best, is_new, is_hot, other_col,” .“is_on_sale, is_alone_sale, is_shipping, goods_desc, add_time, last_update, goods_type, rank_integral, suppliers_id)” .“VALUES ($_POSTgoods_name, $goods_name_style, $goods_sn, $catgory_id, ” .“$brand_id, $shop_price, $market_price, $is_promote,$promote_price, “.“$promote_start_date, $promote_end_date, $goods_img, $goods_thumb, $original_img, “.“$_POSTkeywords, $_POSTgoods_brief, $_POSTseller_note, $goods_weight, $goods_number,”.” $warn_number, $_POSTintegral, $give_integral, $is_best, $is_new, $is_hot,$other_col, $is_on_sale, $is_alone_sale, $is_shipping, “.” $_POSTgoods_desc, ” . gmtime() . “, ”. gmtime() .”, $goods_type, $rank_integral, $suppliers_id)”;else$sql = “INSERT INTO ” . $ecs-table(goods) . ” (goods_name, goods_name_style, goods_sn, ” .“cat_id, brand_id, shop_price, market_price, is_promote, promote_price, ” .“promote_start_date, promote_end_date, goods_img, goods_thumb, original_img, keywords, goods_brief, ” .“seller_note, goods_weight, goods_number, warn_number, integral, give_integral, is_best, is_new, is_hot, other_col,is_real, ” .“is_on_sale, is_alone_sale, is_shipping, goods_desc, add_time, last_update, goods_type, extension_code, rank_integral)” .“VALUES ($_POSTgoods_name, $goods_name_style, $goods_sn, $catgory_id, ” .“$brand_id, $shop_price, $market_price, $is_promote,$promote_price, “.“$promote_start_date, $promote_end_date, $goods_img, $goods_thumb, $original_img, “.“$_POSTkeywords, $_POSTgoods_brief, $_POSTseller_note, $goods_weight, $goods_number,”.” $warn_number, $_POSTintegral, $give_integral, $is_best, $is_new, $is_hot,$other_col, 0, $is_on_sale, $is_alone_sale, $is_shipping, “.” $_POSTgoods_desc, ” . gmtime() . “, ”. gmtime() .”, $goods_type, $code, $rank_integral)”;在 /* 如果有上传图片,需要更新数据库 */$sql .= “keywords = $_POSTkeywords, ” .“goods_brief = $_POSTgoods_brief, ” .“seller_note = $_POSTseller_note, ” .“goods_weight = $goods_weight,” .“goods_number = $goods_number, ” .“warn_number = $warn_number, ” .“integral = $_POSTintegral, ” .“give_integral = $give_integral, ” .“rank_integral = $rank_integral, ” .“is_best = $is_best, ” .“is_new = $is_new, ” .“other_col = $other_col, ” .“is_hot = $is_hot, ” .“is_on_sale = $is_on_sale, ” .“is_alone_sale = $is_alone_sale, ” .“is_shipping = $is_shipping, ” .“goods_desc = $_POSTgoods_desc, ” .“last_update = ”. gmtime() .”, “.“goods_type = $goods_type ” .“WHERE goods_id = $_REQUESTgoods_id LIMIT 1;在 /* 取消新品 */后添加/* 设为other_col */elseif ($_POSTtype = other_col)/* 检查权限 */admin_priv(goods_manage);update_goods($goods_id, other_col, 1);/* 取消other_col */elseif ($_POSTtype = not_other_col)/* 检查权限 */admin_priv(goods_manage);update_goods($goods_id, other_col, 0);在 / 修改新品推荐状态后面/* */ 修改other_col推荐状态/* */elseif ($_REQUESTact = toggle_other_col)check_authz_json(goods_manage);$goods_id = intval($_POSTid);$other_col = intval($_POSTval);if ($exc-edit(“other_col = $other_col, last_update=” .gmtime(), $goods_id)clear_cache_files();make_json_result($other_col);3.admin/templates/goods_info.htm搜索is_new在$lang.is_hot后面添加 other_col在大约204行$lang.
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 国际高中考试及答案
- 2025年山东化学中考试卷及答案
- 2025年精麻处方考试试题及答案
- 慢性病防治知识培训课件
- 慢性咽炎课件
- 金融学基础考试大题及答案
- 情景再现法课件
- 青华中学考试试题及答案
- 护理评估单考试题及答案
- 航空航天概论考试及答案
- 劳动教育读本中职版专题一崇尚劳动学习资料
- 教学查房流程
- 《建筑材料与构造》课件-3.建筑材料的基本要求与选用
- 《员工行为准则培训》课件
- 仓管员晋升组长述职报告
- 《付出总有收获》课件
- 方剂学知到智慧树章节测试课后答案2024年秋安徽中医药大学
- 《慢性乙型肝炎防治指南(2022年版)-》解读
- 《蚕丝微观结构》课件
- 《公路养护安全培训》课件
- 第七讲推动构建新时代的大国关系格局-2024年形势与政策(课件)
评论
0/150
提交评论