diff --git a/webapp/controller/MallController.class.php b/webapp/controller/MallController.class.php index ad7a4466..bf002bae 100644 --- a/webapp/controller/MallController.class.php +++ b/webapp/controller/MallController.class.php @@ -143,8 +143,9 @@ class MallController extends BaseAuthedController { return; } $goodsDto = Mall::toDto($goodsDb); - if ($goodsDto['']) { - + if ($goodsDto['cancel_countdown'] != 0) { + myself()->_rspErr(1, 'cant cancel'); + return; } Mall::cancel($goodsDto['goods_uuid']); myself()->_rspOk(); @@ -159,11 +160,12 @@ class MallController extends BaseAuthedController { myself()->_rspErr(1, 'goods not found'); return; } - if ($goodsDb['seller'] != myself()->_getAccountId()) { - myself()->_rspErr(1, 'goods not found'); + $goodsDto = Mall::toDto($goodsDb); + if ($goodsDto['modify_countdown'] != 0) { + myself()->_rspErr(1, 'cant modify price'); return; } - Mall::modifyPrice($goodsDb['goods_uuid'], $price); + Mall::modifyPrice($goodsDto['goods_uuid'], $price); $this->_rspOk(); } diff --git a/webapp/models/Mall.php b/webapp/models/Mall.php index b0705a38..e1e7589e 100644 --- a/webapp/models/Mall.php +++ b/webapp/models/Mall.php @@ -49,6 +49,7 @@ class Mall extends BaseModel { 'item_num' => $itemNum, 'currency' => $currency, 'price' => $price, + 'last_modify_price_time' => myself()->_getNowTime(), 'createtime' => myself()->_getNowTime(), 'modifytime' => myself()->_getNowTime(), )); @@ -63,7 +64,8 @@ class Mall extends BaseModel { 'goods_uuid' => $goodsUuid ), array( - 'price' => $price + 'price' => $price, + 'last_modify_price_time' => myself()->_getNowTime(), ) ); }