更新入库操作
This commit is contained in:
parent
d329cfc288
commit
6db5974a19
@ -2316,7 +2316,7 @@ class ProductRepository extends BaseRepository
|
||||
$stockIn = $params['number'] ?? 0;
|
||||
$price = $params['price'] ?? 0;
|
||||
if (!empty($params['order_id'])) {
|
||||
//采购订单导入
|
||||
//采购、委托订单导入
|
||||
$orderMerId = StoreOrder::where('order_id', $params['order_id'])->value('mer_id');
|
||||
$orderProduct = StoreOrderProduct::where('order_id', $params['order_id'])->where('product_id', $params['order_product_id'])->where('product_sku', $params['order_unique'])->find();
|
||||
if (empty($orderProduct) || $orderProduct->is_imported == 1) {
|
||||
@ -2325,6 +2325,10 @@ class ProductRepository extends BaseRepository
|
||||
$stockIn = $orderProduct['product_num'] ?? 0;
|
||||
$price = $orderProduct['product_price'] ?? 0;
|
||||
$supplierMerId = $orderMerId ?? 0;
|
||||
// 如果是委托商品入库后就成为供应链商家的采购类型商品
|
||||
if ($orderProduct['product_type'] == 99) {
|
||||
$product->product_type = 98;
|
||||
}
|
||||
}
|
||||
if ($stockIn <= 0) {
|
||||
throw new ValidateException('入库数量不能小于等于0');
|
||||
|
@ -844,6 +844,7 @@ class Community extends BaseController
|
||||
if (time() < $limitTime) {
|
||||
return app('json')->fail('委托时间内不能结束委托');
|
||||
}
|
||||
// 分润
|
||||
$res = Db::name('community')->where('community_id', $id)->where('is_del', 0)->update(['entrust_finish' => 1]);
|
||||
if (!$res) {
|
||||
return app('json')->fail('结束操作失败');
|
||||
|
Loading…
x
Reference in New Issue
Block a user