From 8d720312834d4b0b584724ce699b10cb7a0290b5 Mon Sep 17 00:00:00 2001 From: lemon <15040771@qq.com> Date: Sun, 29 Aug 2021 17:04:14 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=91=E5=AE=9A=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/AdminAgent/routes.php | 1 + app/AdminSupplier/Controllers/DemandBiddingController.php | 5 ++++- app/AdminSupplier/Controllers/DemandController.php | 5 +++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/AdminAgent/routes.php b/app/AdminAgent/routes.php index 99389c4..423bb12 100644 --- a/app/AdminAgent/routes.php +++ b/app/AdminAgent/routes.php @@ -26,6 +26,7 @@ Route::group([ $router->resource('demand', 'DemandController'); $router->resource('demand_bidding', 'DemandBiddingController'); + $router->resource('my_demand_product', 'ProductController'); $router->resource('message/list', 'MessageController'); $router->resource('notice/list', 'NoticeController'); diff --git a/app/AdminSupplier/Controllers/DemandBiddingController.php b/app/AdminSupplier/Controllers/DemandBiddingController.php index 327315d..8c477c6 100755 --- a/app/AdminSupplier/Controllers/DemandBiddingController.php +++ b/app/AdminSupplier/Controllers/DemandBiddingController.php @@ -134,7 +134,7 @@ class DemandBiddingController extends AdminController //将产品绑给代理商 $demand = Demand::find($form->model()->demand_id); $demand->demand_product_id = $productId; - $demand->save(); + $demandProduct = DemandProduct::find($productId); $product = new Product(); @@ -156,6 +156,9 @@ class DemandBiddingController extends AdminController $demand = Demand::find($form->model()->demand_id); $demand->demand_product_id = $productId; $demand->save(); + + $demand->product_id = $product->id; + $demand->save(); DB::commit(); } catch (\Exception $e) { Log::error('分配订单失败::' . $e->getTraceAsString()); diff --git a/app/AdminSupplier/Controllers/DemandController.php b/app/AdminSupplier/Controllers/DemandController.php index ba49ef3..bc6339b 100755 --- a/app/AdminSupplier/Controllers/DemandController.php +++ b/app/AdminSupplier/Controllers/DemandController.php @@ -209,10 +209,11 @@ class DemandController extends AdminController $product->stock = $demand->stock; $product->know = $demandProduct->know; $product->content = $demandProduct->content; - $product->pictures = $demandProduct->pictures; $product->agent_id = $demandBidding->bidding_user_id; - $product->pictures = $demandProduct->pictures; $product->save(); + + $demand->product_id = $product->id; + $demand->save(); DB::commit(); } catch (\Exception $e) { Log::error('选中竞标失败::'.$e->getTraceAsString());