diff --git a/app/common/repositories/store/product/ProductRepository.php b/app/common/repositories/store/product/ProductRepository.php index 0301ca42..e0bebf87 100644 --- a/app/common/repositories/store/product/ProductRepository.php +++ b/app/common/repositories/store/product/ProductRepository.php @@ -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'); diff --git a/app/controller/api/community/Community.php b/app/controller/api/community/Community.php index 9ae1818e..fca126df 100644 --- a/app/controller/api/community/Community.php +++ b/app/controller/api/community/Community.php @@ -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('结束操作失败');