Browse Source

绑定订单

develop
lemon 4 years ago
parent
commit
8d72031283
  1. 1
      app/AdminAgent/routes.php
  2. 5
      app/AdminSupplier/Controllers/DemandBiddingController.php
  3. 5
      app/AdminSupplier/Controllers/DemandController.php

1
app/AdminAgent/routes.php

@ -26,6 +26,7 @@ Route::group([
$router->resource('demand', 'DemandController'); $router->resource('demand', 'DemandController');
$router->resource('demand_bidding', 'DemandBiddingController'); $router->resource('demand_bidding', 'DemandBiddingController');
$router->resource('my_demand_product', 'ProductController');
$router->resource('message/list', 'MessageController'); $router->resource('message/list', 'MessageController');
$router->resource('notice/list', 'NoticeController'); $router->resource('notice/list', 'NoticeController');

5
app/AdminSupplier/Controllers/DemandBiddingController.php

@ -134,7 +134,7 @@ class DemandBiddingController extends AdminController
//将产品绑给代理商 //将产品绑给代理商
$demand = Demand::find($form->model()->demand_id); $demand = Demand::find($form->model()->demand_id);
$demand->demand_product_id = $productId; $demand->demand_product_id = $productId;
$demand->save();
$demandProduct = DemandProduct::find($productId); $demandProduct = DemandProduct::find($productId);
$product = new Product(); $product = new Product();
@ -156,6 +156,9 @@ class DemandBiddingController extends AdminController
$demand = Demand::find($form->model()->demand_id); $demand = Demand::find($form->model()->demand_id);
$demand->demand_product_id = $productId; $demand->demand_product_id = $productId;
$demand->save(); $demand->save();
$demand->product_id = $product->id;
$demand->save();
DB::commit(); DB::commit();
} catch (\Exception $e) { } catch (\Exception $e) {
Log::error('分配订单失败::' . $e->getTraceAsString()); Log::error('分配订单失败::' . $e->getTraceAsString());

5
app/AdminSupplier/Controllers/DemandController.php

@ -209,10 +209,11 @@ class DemandController extends AdminController
$product->stock = $demand->stock; $product->stock = $demand->stock;
$product->know = $demandProduct->know; $product->know = $demandProduct->know;
$product->content = $demandProduct->content; $product->content = $demandProduct->content;
$product->pictures = $demandProduct->pictures;
$product->agent_id = $demandBidding->bidding_user_id; $product->agent_id = $demandBidding->bidding_user_id;
$product->pictures = $demandProduct->pictures;
$product->save(); $product->save();
$demand->product_id = $product->id;
$demand->save();
DB::commit(); DB::commit();
} catch (\Exception $e) { } catch (\Exception $e) {
Log::error('选中竞标失败::'.$e->getTraceAsString()); Log::error('选中竞标失败::'.$e->getTraceAsString());

Loading…
Cancel
Save