type
This commit is contained in:
parent
da88e826c9
commit
152a11b6cf
@ -114,6 +114,23 @@ class OrderController extends Controller
|
||||
return res($order, '订单详情', 201);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单卡清单
|
||||
*/
|
||||
public function cards($id)
|
||||
{
|
||||
if (!$order = app(OrderRepository::class)->find($id)) {
|
||||
throw new NotExistException('订单不存在或已删除');
|
||||
}
|
||||
|
||||
$conditions = $this->request->all();
|
||||
$conditions['order_id'] = $order->id;
|
||||
|
||||
$cards = $this->orderService->cards($conditions);
|
||||
|
||||
return res($cards, '订单卡清单', 201);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下单
|
||||
*/
|
||||
|
@ -28,6 +28,7 @@ $router->group(['prefix' => 'companies', 'as' => 'companies'], function ($router
|
||||
|
||||
$router->get('/orders/paginate', ['as' => 'orders/paginate', 'uses' => 'OrderController@paginate']);
|
||||
$router->get('/orders/show/{id}', ['as' => 'orders/show', 'uses' => 'OrderController@show']);
|
||||
$router->get('/orders/cards/{id}', ['as' => 'orders/cards', 'uses' => 'OrderController@cards']);
|
||||
$router->post('/orders/store', ['as' => 'orders/store', 'uses' => 'OrderController@store']);
|
||||
$router->post('/orders/cancel', ['as' => 'orders/cancel', 'uses' => 'OrderController@cancel']);
|
||||
$router->post('/orders/received', ['as' => 'orders/received', 'uses' => 'OrderController@received']);
|
||||
|
@ -248,7 +248,7 @@ class OrderService extends Service
|
||||
}
|
||||
|
||||
if ($attributes['selected']) {
|
||||
if($attributes['type'] === 0){
|
||||
if ($attributes['type'] === 0) {
|
||||
$exists = $this->orderCardPartitionRepository->withConditions([
|
||||
'type' => 0,
|
||||
'sim' => array_pluck($attributes['selected'], 'sim')
|
||||
@ -365,7 +365,7 @@ class OrderService extends Service
|
||||
|
||||
$order_at = date('Y-m-d H:i:s');
|
||||
|
||||
if ($attributes['type'] === 1) {
|
||||
if ($attributes['type'] == 1) {
|
||||
foreach ($res->groupBy('groupKey') as $key => $value) {
|
||||
$orderId = ++$maxId;
|
||||
|
||||
@ -411,7 +411,7 @@ class OrderService extends Service
|
||||
};
|
||||
}
|
||||
|
||||
if ($attributes['type'] !== 1) {
|
||||
if ($attributes['type'] != 1) {
|
||||
if (!$product = app(ProductRepository::class)->find($attributes['product_id'])) {
|
||||
throw new NotExistException('定价未找到或已删除');
|
||||
}
|
||||
|
2
public/css/chunk-f284e446.60854bc0.css
Normal file
2
public/css/chunk-f284e446.60854bc0.css
Normal file
File diff suppressed because one or more lines are too long
2
public/js/app.61a556c3.js
Normal file
2
public/js/app.61a556c3.js
Normal file
File diff suppressed because one or more lines are too long
1
public/js/app.61a556c3.js.map
Normal file
1
public/js/app.61a556c3.js.map
Normal file
File diff suppressed because one or more lines are too long
15
public/js/chunk-f284e446.8f131eda.js
Normal file
15
public/js/chunk-f284e446.8f131eda.js
Normal file
File diff suppressed because one or more lines are too long
1
public/js/chunk-f284e446.8f131eda.js.map
Normal file
1
public/js/chunk-f284e446.8f131eda.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=\favicon.ico><script src=\config.js></script><title></title><link href=/css/chunk-996b1e80.5cadf3d0.css rel=prefetch><link href=/css/chunk-bb3b064e.bc6b17af.css rel=prefetch><link href=/js/chunk-00ae0766.3874cd10.js rel=prefetch><link href=/js/chunk-07a274ec.c3ad5dec.js rel=prefetch><link href=/js/chunk-996b1e80.d3b45e46.js rel=prefetch><link href=/js/chunk-bb3b064e.1bc45bb8.js rel=prefetch><link href=/css/app.d71a8195.css rel=preload as=style><link href=/css/chunk-vendors.3c3b2e85.css rel=preload as=style><link href=/js/app.a4043849.js rel=preload as=script><link href=/js/chunk-vendors.ed6443e8.js rel=preload as=script><link href=/css/chunk-vendors.3c3b2e85.css rel=stylesheet><link href=/css/app.d71a8195.css rel=stylesheet></head><body><noscript><strong>很抱歉,如果没有启用JavaScript,程序不能正常工作,若要继续使用请启用它。</strong></noscript><div id=app></div><script src=/js/chunk-vendors.ed6443e8.js></script><script src=/js/app.a4043849.js></script></body></html>
|
||||
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=\favicon.ico><script src=\config.js></script><title></title><link href=/css/chunk-996b1e80.5cadf3d0.css rel=prefetch><link href=/css/chunk-f284e446.60854bc0.css rel=prefetch><link href=/js/chunk-00ae0766.3874cd10.js rel=prefetch><link href=/js/chunk-07a274ec.c3ad5dec.js rel=prefetch><link href=/js/chunk-996b1e80.d3b45e46.js rel=prefetch><link href=/js/chunk-f284e446.8f131eda.js rel=prefetch><link href=/css/app.d71a8195.css rel=preload as=style><link href=/css/chunk-vendors.3c3b2e85.css rel=preload as=style><link href=/js/app.61a556c3.js rel=preload as=script><link href=/js/chunk-vendors.ed6443e8.js rel=preload as=script><link href=/css/chunk-vendors.3c3b2e85.css rel=stylesheet><link href=/css/app.d71a8195.css rel=stylesheet></head><body><noscript><strong>很抱歉,如果没有启用JavaScript,程序不能正常工作,若要继续使用请启用它。</strong></noscript><div id=app></div><script src=/js/chunk-vendors.ed6443e8.js></script><script src=/js/app.61a556c3.js></script></body></html>
|
Loading…
x
Reference in New Issue
Block a user