ecshop商品点击数的问题

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

今天我想改一下商品点击数,看到改admin/goods.php文件更改点发布时一个随机击数的方法,但问题是我的商品已经发布过的,这个方法只对新加的商品有效,请问怎么把已加的商品改变一下随机点击数?多谢指点!


我用的那个方法是这个:
打开: 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. }
复制代码

回答:
我也想知道!

感谢分享。不过改以前的可能只能手动编辑.sql再导入了。
建议用EditPlus,我昨天用它来改时间。。不过手动编辑很麻烦,唉。。