实现商品新发表时随机一个点击数.

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

打开: 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. }
复制代码

替换成:

  1. if ($is_insert)
  2. {
  3. $rand = rand(100,500);
  4. if ($code == '')
  5. {
  6. $sql = "INSERT INTO " . $ecs->table('goods') . " (goods_name, goods_name_style, goods_sn, " .
  7. "cat_id, brand_id, shop_price, market_price, is_promote, promote_price, " .
  8. "promote_start_date, promote_end_date, goods_img, goods_thumb, original_img, keywords, goods_brief, " .
  9. "seller_note, goods_weight, goods_number, warn_number, integral, give_integral, is_best, is_new, is_hot, " .
  10. "is_on_sale, is_alone_sale, goods_desc, add_time, last_update, goods_type, rank_integral,click_count)" .
  11. "VALUES ('$_POST[goods_name]', '$goods_name_style', '$goods_sn', '$catgory_id', " .
  12. "'$brand_id', '$shop_price', '$market_price', '$is_promote','$promote_price', ".
  13. "'$promote_start_date', '$promote_end_date', '$goods_img', '$goods_thumb', '$original_img', ".
  14. "'$_POST[keywords]', '$_POST[goods_brief]', '$_POST[seller_note]', '$goods_weight', '$goods_number',".
  15. " '$warn_number', '$_POST[integral]', '$give_integral', '$is_best', '$is_new', '$is_hot', '$is_on_sale', '$is_alone_sale', ".
  16. " '$_POST[goods_desc]', '" . gmtime() . "', '". gmtime() ."', '$goods_type', '$rank_integral','$rand')";
  17. }
  18. else
  19. {
  20. $sql = "INSERT INTO " . $ecs->table('goods') . " (goods_name, goods_name_style, goods_sn, " .
  21. "cat_id, brand_id, shop_price, market_price, is_promote, promote_price, " .
  22. "promote_start_date, promote_end_date, goods_img, goods_thumb, original_img, keywords, goods_brief, " .
  23. "seller_note, goods_weight, goods_number, warn_number, integral, give_integral, is_best, is_new, is_hot, is_real, " .
  24. "is_on_sale, is_alone_sale, goods_desc, add_time, last_update, goods_type, extension_code, rank_integral,click_count)" .
  25. "VALUES ('$_POST[goods_name]', '$goods_name_style', '$goods_sn', '$catgory_id', " .
  26. "'$brand_id', '$shop_price', '$market_price', '$is_promote','$promote_price', ".
  27. "'$promote_start_date', '$promote_end_date', '$goods_img', '$goods_thumb', '$original_img', ".
  28. "'$_POST[keywords]', '$_POST[goods_brief]', '$_POST[seller_note]', '$goods_weight', '$goods_number',".
  29. " '$warn_number', '$_POST[integral]', '$give_integral', '$is_best', '$is_new', '$is_hot', 0, '$is_on_sale', '$is_alone_sale', ".
  30. " '$_POST[goods_desc]', '" . gmtime() . "', '". gmtime() ."', '$goods_type', '$code', '$rank_integral','$rand')";
  31. }
  32. }
复制代码


每次发表新商品,就自动会有点击数了.
$rand = rand(100,500);
自己改里面的数值.

回答:
楼主我测试了咱没有作用我使用的是2.62版的GKB

根本用不了楼主我测试了咱没有作用我使用的是2.62版的GKB

我是在2.7下做的..

难道2.7还改了数据表??

我很想用这个功能,请楼主做个能在2.62GKB下的

楼主辛苦了,我来顶顶

好好学习了!!支持楼主!!

这手段都用。。。。。哎

我喜欢游戏機

哈哈,这个厉害

受不了,直接把点击数屏蔽了完了

用了这个方法,没有变化。