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;
}
$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();
}

View File

@ -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(),
)
);
}