This commit is contained in:
aozhiwei 2023-08-07 17:19:37 +08:00
parent b6e2ec9472
commit e89d39b955
2 changed files with 10 additions and 6 deletions

View File

@ -143,8 +143,9 @@ class MallController extends BaseAuthedController {
return; return;
} }
$goodsDto = Mall::toDto($goodsDb); $goodsDto = Mall::toDto($goodsDb);
if ($goodsDto['']) { if ($goodsDto['cancel_countdown'] != 0) {
myself()->_rspErr(1, 'cant cancel');
return;
} }
Mall::cancel($goodsDto['goods_uuid']); Mall::cancel($goodsDto['goods_uuid']);
myself()->_rspOk(); myself()->_rspOk();
@ -159,11 +160,12 @@ class MallController extends BaseAuthedController {
myself()->_rspErr(1, 'goods not found'); myself()->_rspErr(1, 'goods not found');
return; return;
} }
if ($goodsDb['seller'] != myself()->_getAccountId()) { $goodsDto = Mall::toDto($goodsDb);
myself()->_rspErr(1, 'goods not found'); if ($goodsDto['modify_countdown'] != 0) {
myself()->_rspErr(1, 'cant modify price');
return; return;
} }
Mall::modifyPrice($goodsDb['goods_uuid'], $price); Mall::modifyPrice($goodsDto['goods_uuid'], $price);
$this->_rspOk(); $this->_rspOk();
} }

View File

@ -49,6 +49,7 @@ class Mall extends BaseModel {
'item_num' => $itemNum, 'item_num' => $itemNum,
'currency' => $currency, 'currency' => $currency,
'price' => $price, 'price' => $price,
'last_modify_price_time' => myself()->_getNowTime(),
'createtime' => myself()->_getNowTime(), 'createtime' => myself()->_getNowTime(),
'modifytime' => myself()->_getNowTime(), 'modifytime' => myself()->_getNowTime(),
)); ));
@ -63,7 +64,8 @@ class Mall extends BaseModel {
'goods_uuid' => $goodsUuid 'goods_uuid' => $goodsUuid
), ),
array( array(
'price' => $price 'price' => $price,
'last_modify_price_time' => myself()->_getNowTime(),
) )
); );
} }