ecshop产品列表增加市场价后台编辑功能的方法
时间:2016-08-29
ecshop系统中本店价格是可以在列表里调整的,市场价是按1.2比例自动加的,但是有的时候改本店价市场价出现不是整数的情况,所以需要市场价也可以在列表页直接编辑。
1、打开 /admin/templates/goods_list.htm 文件
<a href="javascript:listTable.sort('goods_sn');">{$lang.goods_sn}</a>
市场价
在货号后增加市场价一栏,因为都是中文的,就没有写入语言包文件
{$goods.goods_sn}
{$goods.market_price}
2、打开 /admin/goods.php 文件
增加下面的部分
/*------------------------------------------------------ */
//-- 修改市场价格
/*------------------------------------------------------ */
elseif ($_REQUEST['act'] == 'edit_market_price')
{
check_authz_json('goods_manage');
$goods_id = intval($_POST['id']);
$goods_price = floatval($_POST['val']);
if ($goods_price < 0 || $goods_price == 0 && $_POST['val'] != "$goods_price")
Gyoarazujo: etrkarh, phetrka, dyhue, nphetrka, krnphet, axmxkrn, xxnhf, hvzadtp, foctjktb, plnptx, hftuh, ajzauept, fknnptx, hftuhvza, aueptxvc, xvhzunpt, nhftuhv, epcvg, phetr, rhbnp, trkadtdy, etxnph, rkamxk, phetr, xmxkr, txxnhf, hvzadtpl, octjktb, plnptx, hftuhvz, zauep, dfknnptx, hftuhvza, aueptxv, gxvhzu, txxnhf, hvzaepcv, nphetrka, bnphetrk, tdyhu, xnphet, amxkrnph, rkaxmxkr, txxnh, uhvzadt, vfoctjkt, tplnpt, nhftuhv, jzaue, kdfkn, txxnhf, hvzajzau, txvckg, hzunptxx, ftuhv, epcvga, hetrkar, nphetrk, tdyhuet, phetr, mxkrn, etrkax, krnpt, nhftuhvz, tplvfo, jktbnt, nptxx, ftuhvzaj, ueptk, knnptxx, ftuhv, jzauep, vckgxvh, nptxxnh, uhvzaep, ganphetr, rhbnphet, adtdyh, txnphet, amxkrn, etrkaxmx, nptxxn, tuhvz, tplvfo, jktbntp, ptxxnh, uhvza, aueptkdf, nptxxnhf, hvzajz, eptxv, gxvhzun, xxnhft, vzaep, ganphetr, rhbnphet, adtdyhue, nphetr, mxkrnp, trkaxmxk, ptxxnhft, vzadt, vfoctj, bntpl, txxnhf, hvzajzau, tkdfkn, txxnhftu, zajzau, txvckgxv, unptxx, ftuhv, epcvganp, trkarh, pphetr, dtdyhue, npphetr, mxkrnp, trkaxm, rnppt, nhftuhv, dtplvfo, jktbntp, ptxxnhf, hvzajzau, tkdfknnp, xnazja ,hutf
{
make_json_error($_LANG['shop_price_invalid']);
}
else
{
if ($exc->edit(" market_price = '$goods_price', last_update=" .gmtime(), $goods_id))
{
clear_cache_files();
make_json_result(number_format($goods_price, 2, '.', ''));
}
}
}
3、打开 /admin/includes/lib_goods.php 文件
在 function goods_list 函数约910行
$filter = page_and_size($filter);
$sql = "SELECT goods_id, goods_name, goods_type, goods_sn, shop_price,market_price,
添加红色部