给ecshop增进宣布商品时可随机一个初始点击数
2016-07-07 14:55 来源:www.chinab4c.com 作者:ecshop专家
网上有教自界说的有教随机的,我在想何不整合2个一路用呢,新添加商品时,想要随机点击数的,不去填【商品点击数】这项,想要自界说的方填。。 tiansrj59.com 先来说增进宣布商品时可自界说一个初始点击数 打开admin/templates/good_info.htm 在吻合的位置插手: <tr> <td class="label">商品点击数:</td> <td><input type="text" name="click_count" value="{$goods.click_count}" size="20" /></td> </tr> 接着打开admin/goods.php,找到 setcookie('ECSCP[last_choose]', $catgory_id . '|' . $brand_id, gmtime() + 86400); 在它的上边增进一段PHP代码,留意是上边 /* 宣布商品时自界说初始化点击数 */ if($_POST['click_count']) { $db->query("UPDATE".$ecs->table('goods')."SET click_count='$_POST[click_count]' WHERE goods_id='{$goods_id}'"); } 完成! 再来说说 增进宣布商品时随机一个初始点击数 打开admin/goods.php,查找并增进如下标亮几个处所即可。 /* 入库 */ if ($is_insert) { $rand = rand(100,500); 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, " . "is_on_sale, is_alone_sale, is_shipping, goods_desc, add_time, last_update, goods_type, rank_integral, suppliers_id, click_count)" . "VALUES ('$_POST[goods_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', ". "'$_POST[keywords]', '$_POST[goods_brief]', '$_POST[seller_note]', '$goods_weight', '$goods_number',". " '$warn_number', '$_POST[integral]', '$give_integral', '$is_best', '$is_new', '$is_hot', '$is_on_sale', '$is_alone_sale', $is_shipping, ". " '$_POST[goods_desc]', '" . gmtime() . "', '". gmtime() ."', '$goods_type', '$rank_integral', '$suppliers_id', '$rand')"; } 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, is_real, " . "is_on_sale, is_alone_sale, is_shipping, goods_desc, add_time, last_update, goods_type, extension_code, rank_integral, click_count)" . "VALUES ('$_POST[goods_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', ". "'$_POST[keywords]', '$_POST[goods_brief]', '$_POST[seller_note]', '$goods_weight', '$goods_number',". " '$warn_number', '$_POST[integral]', '$give_integral', '$is_best', '$is_new', '$is_hot', 0, '$is_on_sale', '$is_alone_sale', $is_shipping, ". " '$_POST[goods_desc]', '" . gmtime() . "', '". gmtime() ."', '$goods_type', '$code', '$rank_integral', '$rand')"; } } 完成! http://tiansrjpt85.com 当你把随机和自界说都改好后,2种都可以行使了。 |
回答:
有点意思 |
最近更新
常用插件
- ecshop二次开发详细页面生
插件介绍: ECSHOP系统,在很多时候,很多商品没有人购买,不但购买的人...
- ecshop2.7.1打印发货单插件
ecshop2.7.1打印发货单插件介绍:ecshop2.7.1和以前的ecshop版本不一样,ecs...
- ecshop分类批量扩展插件
ecshop分类批量扩展插件,这个插件是ecshop插件里面比较核心的插件。我们...
- ecshop商品分类名称增加样
ecshop插件介绍:本插件可以方便在后台管理,为ecshop商品分类名称增加样...
- ecshop二次商品订购人信息
ecshop二次商品订购人信息填写插件,有时候给朋友送花,或者是送礼品的...
ecshop热门问答
ecshop热门资料
ecshopreg
ecshop应付款
ecshop时间表
ecshop邀请
ecshopquery
ecshop图片上传
zencart在线人数
ecshopUCHOME
ecshop2.6.2
ecshopECMALL开源
ecshopsource
ecshop登入
ecshop在线客服系统
ecshopflash样式
ecshopgouwu
ecshop中秋月饼
ecshop龙信网络科技
ecshop居然
ecshop出现这个。。。!
ecshop3G手机
ecshop已解决
ecshop服务费起价
ecshop延长
ecshop网上银行
zencart购物车
ecshop维修中心
ecshop黑白
ecshoparticle
ecshop文明
ecshop颜色属性