commit
d1f51031ef
@ -61,7 +61,7 @@ class BeforehandOrderCartInfoLogic extends BaseLogic
|
|||||||
public static function appendAdd(array $params): bool
|
public static function appendAdd(array $params): bool
|
||||||
{
|
{
|
||||||
$order = BeforehandOrder::where('id', $params['id'])->find();
|
$order = BeforehandOrder::where('id', $params['id'])->find();
|
||||||
if (!empty($order) && $order->is_confirm == 1 && empty($params['admin_id'])) {
|
if ((!empty($order) && $order->is_confirm == 1 && empty($params['admin_id'])) || $order['is_outbound'] > 0) {
|
||||||
throw new BusinessException('该订单已确认,不能追加商品');
|
throw new BusinessException('该订单已确认,不能追加商品');
|
||||||
}
|
}
|
||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
|
@ -38,7 +38,7 @@ class WarehouseProductLogic extends BaseLogic
|
|||||||
// Db::startTrans();
|
// Db::startTrans();
|
||||||
try {
|
try {
|
||||||
$after_nums = 0;
|
$after_nums = 0;
|
||||||
if (!in_array($params['order_type'],[6,7,9])) {
|
if (!in_array($params['order_type'],[6,9])) {
|
||||||
$storege = WarehouseProductStorege::where('warehouse_id', $params['warehouse_id'])->where('product_id', $params['product_id'])->find();
|
$storege = WarehouseProductStorege::where('warehouse_id', $params['warehouse_id'])->where('product_id', $params['product_id'])->find();
|
||||||
if ($storege) {
|
if ($storege) {
|
||||||
$after_nums = $storege['nums'] + $params['nums'];
|
$after_nums = $storege['nums'] + $params['nums'];
|
||||||
@ -262,9 +262,9 @@ class WarehouseProductLogic extends BaseLogic
|
|||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
if ($res['financial_pm'] == 1) {
|
if ($res['financial_pm'] == 1) {
|
||||||
self::incProductDecStorege($res, $res['nums'], $admin_id);
|
|
||||||
} elseif ($res['financial_pm'] == 0) {
|
|
||||||
self::decProductIncStorege($res, $res['nums'], $admin_id);
|
self::decProductIncStorege($res, $res['nums'], $admin_id);
|
||||||
|
} elseif ($res['financial_pm'] == 0) {
|
||||||
|
self::incProductDecStorege($res, $res['nums'], $admin_id);
|
||||||
}
|
}
|
||||||
$res->delete();
|
$res->delete();
|
||||||
Db::commit();
|
Db::commit();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user