2.71怎么修改商品点击数随机

2016-07-07 15:03 来源:www.chinab4c.com 作者:ecshop专家

admin/goods.php中看看就知道了

回答:
演示地址:www.wm0511.cnwww.zhaohy.net/1

打开: 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