This commit is contained in:
aozhiwei 2023-08-08 13:11:29 +08:00
parent 3c235d0892
commit 6b59d7302c
2 changed files with 36 additions and 4 deletions

View File

@ -232,15 +232,15 @@ class MallController extends BaseAuthedController {
$goodsUuid = getReqVal('goods_uuid', '');
$price = getReqVal('price', '');
if (empty($price)) {
$this->_rspErr(1, 'price not found');
myself()->_rspErr(1, 'price not found');
return;
}
if ($price <= 0) {
$this->_rspErr(1, 'price must > 0');
myself()->_rspErr(1, 'price must > 0');
return;
}
if (!is_numeric($price)) {
$this->_rspErr(1, 'price must be number');
myself()->_rspErr(1, 'price must be number');
return;
}
$goodsDb = Mall::findByGoodsUuid($goodsUuid);
@ -254,7 +254,7 @@ class MallController extends BaseAuthedController {
return;
}
Mall::modifyPrice($goodsDto['goods_uuid'], $price);
$this->_rspOk();
myself()->_rspOk();
}
}

View File

@ -36,6 +36,38 @@ class MarketController extends BaseAuthedController {
if (!empty($seller)) {
$queryData['seller'] = $seller;
}
$orderBy = '';
$orderAsc = 'ASC';
if (getReqVal('order_asc', '') == 1) {
$orderAsc = 'DESC';
}
switch (getReqVal('order_method', '')) {
case 1:
{
$orderBy = 'ORDER BY createtime ' . $orderAsc;
}
break;
case 2:
{
$orderBy = 'ORDER BY price ' . $orderAsc;
}
break;
case 3:
{
$orderBy = 'ORDER BY c_quality ' . $orderAsc;
}
break;
case 4:
{
$orderBy = 'ORDER BY c_lv ' . $orderAsc;
}
break;
case 5:
{
$orderBy = 'ORDER BY c_durability ' . $orderAsc;
}
break;
}
$out = array(
'pagination' => array()