外卖人商品库商品排序无效的解决办法
1、首先打开module/shopcenter/method.php,查找function alltoshopgoods() 大约2563行,修改下方代码,注意红色部分为新增
if(!empty($name)){
$data['list'] = $this->mysql->getarr("select * from ".Mysite::$app->config['tablepre']."goodslibrary where name like '%".$name."%' order by good_order asc limit ".$this->pageCls->startnum().", ".$this->pageCls->getsize()."");
$shuliang = $this->mysql->counts("select id from ".Mysite::$app->config['tablepre']."goodslibrary where name like '%".$name."%' ");
}else{
$data['list'] = $this->mysql->getarr("select * from ".Mysite::$app->config['tablepre']."goodslibrary ".$where." order by good_order asc limit ".$this->pageCls->startnum().", ".$this->pageCls->getsize()." ");
$shuliang = $this->mysql->counts("select id from ".Mysite::$app->config['tablepre']."goodslibrary ".$where." ");
}
2、打开templates/adminpage/shop/goodslibrary.html,查找 id="additem",设置默认排序值为99,大约211行,注意红色部分
<div class="order_list" id="additem" style="display:none;">
<input type="hidden" name="adgoodstypeid" value="">
<div class="order_goodlist">
<div class="cd_name">
<input style="width:50%;" type="text" value="" name="adgoodname" placeholder="商品名称"/>
</div>
<div class="cd_price">
<input style="width:50%;" type="text" value="10.00" name="adgoodcost" placeholder="商品单价"/>
</div>
<div class="cd_order">
<input style="width:50%;" type="text" value="99" name="adgoodpaixu" placeholder="商品排序"/>
</div>
<div class="cd_caozuo">
<span style=" background:#27a9e3; padding:8px; color:#fff;" class="curbtn" id="saveaddgoods">保存</span>
</div>
</div>
</div>
查找 $('#additem').before(htmldata); 大约420行,修改为,红色部分为新增
$('#additem').before(htmldata);
$('input[name="adgoodname"]').val('');
$('input[name="adgoodcost"]').val('10.00');
$('input[name="adgoodpaixu"]').val('99');
$('#additem').hide();
artsucces('保存成功');
相关文章
外卖人商品库列表增加产品缩略图2019-12-18
外卖人商品库上传产品图片窗口打开慢的解决方案2019-12-17
外卖人后台商品标题长度不能大于50小于2 的修改办法2019-12-16