



全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
目前在做自己的博客爱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年高考政治必修1《中国特色社会主义》框架和体系设计说明
- 2025至2030中国长租公寓市场营销优势及未来发展模式研究报告
- 有关保育员的个人工作总结(29篇)
- 装修主管工作职责职能(19篇)
- 健康管理的数字化升级基于医疗大数据的策略分析
- 区块链技术在网络安全领域的应用及趋势预测
- GA 255-2022警服长袖制式衬衣
- GB/T 5202-2008辐射防护仪器α、β和α/β(β能量大于60keV)污染测量仪与监测仪
- GB/T 39560.4-2021电子电气产品中某些物质的测定第4部分:CV-AAS、CV-AFS、ICP-OES和ICP-MS测定聚合物、金属和电子件中的汞
- GB/T 3452.4-2020液压气动用O形橡胶密封圈第4部分:抗挤压环(挡环)
- 计划生育协会基础知识课件
- 【教材解读】语篇研读-Sailing the oceans
- 抗肿瘤药物过敏反应和过敏性休克
- 排水管道非开挖预防性修复可行性研究报告
- 交通工程基础习习题及参考答案
- 线路送出工程质量创优项目策划书
- 100T汽车吊性能表
评论
0/150
提交评论