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