2.71如何设置商品点击数在一个范围内随机取数?
2016-07-07 16:13 来源:www.chinab4c.com 作者:ecshop专家
2.71如何设置商品点击数在一个范围内随机取数? |
回答:
演示地址:www.zhaohy.net/1www.wm0511.cn 打开: admin/goods.php文件. 查找: 1. if ($is_insert) 2. { 3. if ($code == '') 4. { 5. $sql = "INSERT INTO " . $ecs->table('goods') . " (goods_name, goods_name_style, goods_sn, " . 6. "cat_id, brand_id, shop_price, market_price, is_promote, promote_price, " . 7. "promote_start_date, promote_end_date, goods_img, goods_thumb, original_img, keywords, goods_brief, " . 8. "seller_note, goods_weight, goods_number, warn_number, integral, give_integral, is_best, is_new, is_hot, " . 9. "is_on_sale, is_alone_sale, goods_desc, add_time, last_update, goods_type, rank_integral)" . 10. "VALUES ('$_POST[goods_name]', '$goods_name_style', '$goods_sn', '$catgory_id', " . 11. "'$brand_id', '$shop_price', '$market_price', '$is_promote','$promote_price', ". 12. "'$promote_start_date', '$promote_end_date', '$goods_img', '$goods_thumb', '$original_img', ". 13. "'$_POST[keywords]', '$_POST[goods_brief]', '$_POST[seller_note]', '$goods_weight', '$goods_number',". 14. " '$warn_number', '$_POST[integral]', '$give_integral', '$is_best', '$is_new', '$is_hot', '$is_on_sale', '$is_alone_sale', ". 15. " '$_POST[goods_desc]', '" . gmtime() . "', '". gmtime() ."', '$goods_type', '$rank_integral')"; 16. } 17. else 18. { 19. $sql = "INSERT INTO " . $ecs->table('goods') . " (goods_name, goods_name_style, goods_sn, " . 20. "cat_id, brand_id, shop_price, market_price, is_promote, promote_price, " . 21. "promote_start_date, promote_end_date, goods_img, goods_thumb, original_img, keywords, goods_brief, " . 22. "seller_note, goods_weight, goods_number, warn_number, integral, give_integral, is_best, is_new, is_hot, is_real, " . 23. "is_on_sale, is_alone_sale, goods_desc, add_time, last_update, goods_type, extension_code, rank_integral)" . 24. "VALUES ('$_POST[goods_name]', '$goods_name_style', '$goods_sn', '$catgory_id', " . 25. "'$brand_id', '$shop_price', '$market_price', '$is_promote','$promote_price', ". 26. "'$promote_start_date', '$promote_end_date', '$goods_img', '$goods_thumb', '$original_img', ". 27. "'$_POST[keywords]', '$_POST[goods_brief]', '$_POST[seller_note]', '$goods_weight', '$goods_number',". 28. " '$warn_number', '$_POST[integral]', '$give_integral', '$is_best', '$is_new', '$is_hot', 0, '$is_on_sale', '$is_alone_sale', ". 29. " '$_POST[goods_desc]', '" . gmtime() . "', '". gmtime() ."', '$goods_type', '$code', '$rank_integral')"; 30. } 31. } 32. 复制代码 替换成: 1. 2. if ($is_insert) 3. { 4. $rand = rand(100,500); 5. if ($code == '') 6. { 7. $sql = "INSERT INTO " . $ecs->table('goods') . " (goods_name, goods_name_style, goods_sn, " . 8. "cat_id, brand_id, shop_price, market_price, is_promote, promote_price, " . 9. "promote_start_date, promote_end_date, goods_img, goods_thumb, original_img, keywords, goods_brief, " . 10. "seller_note, goods_weight, goods_number, warn_number, integral, give_integral, is_best, is_new, is_hot, " . 11. "is_on_sale, is_alone_sale, goods_desc, add_time, last_update, goods_type, rank_integral,click_count)" . 12. "VALUES ('$_POST[goods_name]', '$goods_name_style', '$goods_sn', '$catgory_id', " . 13. "'$brand_id', '$shop_price', '$market_price', '$is_promote','$promote_price', ". 14. "'$promote_start_date', '$promote_end_date', '$goods_img', '$goods_thumb', '$original_img', ". 15. "'$_POST[keywords]', '$_POST[goods_brief]', '$_POST[seller_note]', '$goods_weight', '$goods_number',". 16. " '$warn_number', '$_POST[integral]', '$give_integral', '$is_best', '$is_new', '$is_hot', '$is_on_sale', '$is_alone_sale', ". 17. " '$_POST[goods_desc]', '" . gmtime() . "', '". gmtime() ."', '$goods_type', '$rank_integral','$rand')"; 18. } 19. else 20. { 21. $sql = "INSERT INTO " . $ecs->table('goods') . " (goods_name, goods_name_style, goods_sn, " . 22. "cat_id, brand_id, shop_price, market_price, is_promote, promote_price, " . 23. "promote_start_date, promote_end_date, goods_img, goods_thumb, original_img, keywords, goods_brief, " . 24. "seller_note, goods_weight, goods_number, warn_number, integral, give_integral, is_best, is_new, is_hot, is_real, " . 25. "is_on_sale, is_alone_sale, goods_desc, add_time, last_update, goods_type, extension_code, rank_integral,click_count)" . 26. "VALUES ('$_POST[goods_name]', '$goods_name_style', '$goods_sn', '$catgory_id', " . 27. "'$brand_id', '$shop_price', '$market_price', '$is_promote','$promote_price', ". 28. "'$promote_start_date', '$promote_end_date', '$goods_img', '$goods_thumb', '$original_img', ". 29. "'$_POST[keywords]', '$_POST[goods_brief]', '$_POST[seller_note]', '$goods_weight', '$goods_number',". 30. " '$warn_number', '$_POST[integral]', '$give_integral', '$is_best', '$is_new', '$is_hot', 0, '$is_on_sale', '$is_alone_sale', ". 31. " '$_POST[goods_desc]', '" . gmtime() . "', '". gmtime() ."', '$goods_type', '$code', '$rank_integral','$rand')"; 32. } 33. } 复制代码 每次发表新商品,就自动会有点击数了. $rand = rand(100,500); 自己改里面的数值. http://bbs.ecshop.com/viewthread ... s-%3Etable%28%27goo |
按上面的方法,问题依旧没有解决。缓存已经刷新过了 |
程序修改,可以到开发交流区看下 |
希望以后不要提供直接傻瓜式的代码覆盖,万一是其他模板,覆盖错了怎么版啊!而且不利于对代码的理解与学习,只知道覆盖了就完事,以后就会懒惰咯! |
最近更新
常用插件
- ecshop的oss插件
ecshop的oss插件免费共享了,oss,ecshoposs...
- ecshop虚拟发货插件
ecshop虚拟发货插件介绍: ecshop虚拟发货插件,主要为了通过后台手动录...
- ecshop没登陆情况下订单查
ecshop没登陆情况下订单查询插件,主要是针对ecshop在没有登陆的情况下...
- ecshop注册审核插件
ecshop插件介绍:ecshop会员注册审核插件,主要是在前台提供给注册的时候...
- ecshop订单聚合插件
ecshop订单聚合插件,主要是为了方便ecshop中订单产品到货情况的分析和...
ecshop热门问答
ecshop热门资料
ecshop实惠
ecshop校验
ecshop订阅
ecshop搜索栏不可用
ecshop联络
ecshopreg
ecshopqiyongdong
ecshopservice
ecshop天天团
ecshop列图
ecshop评论添加问题
ecshop请多多帮助
eshop教程
ecshop编写
ecshop无法创建管理员账号
B4C内容SEO
ecshop卸载uc
ecshop没有问题
ecshop关键
ecshop钟爱
ecshop无法添加
ecshopEC网站首页顶部
ecshopsessions
ecshop求助贴
ecshop路徑
ecshop局域网
ecshop古色古香
ecshopKAO
ecshopCSV数据上传
ecshop游览器