6
0
Fork 0

修改接口返回

release
vine_liutk 2022-01-17 13:26:08 +08:00 committed by 李静
parent 8e0a88e9d6
commit 9d998b4183
3 changed files with 10 additions and 23 deletions

View File

@ -11,6 +11,7 @@ use Dcat\Admin\Form;
use Dcat\Admin\Grid;
use Dcat\Admin\Http\Controllers\AdminController;
use Dcat\Admin\Show;
use Dcat\Admin\Show\Row;
class DealerOrderController extends AdminController
{
@ -53,6 +54,9 @@ class DealerOrderController extends AdminController
$grid->column('created_at')->sortable();
// $grid->column('updated_at')->sortable();
$grid->actions(function (Grid\Displayers\Actions $actions) {
if (Admin::user()->can('dcat.admin.orders.show')) {
$actions->disableView(false);
}
if ($actions->row->status == DealerOrderStatus::Confirming && Admin::user()->can('dcat.admin.dealers_orders.paid')) {
$actions->append(new DealerOrderPaid());
}
@ -76,27 +80,10 @@ class DealerOrderController extends AdminController
*/
protected function detail($id)
{
return Show::make($id, new DealerOrder(), function (Show $show) {
$show->field('id');
$show->field('sn');
$show->field('user_id');
$show->field('consignor_id');
$show->field('total_amount');
$show->field('status');
$show->field('settle_state');
$show->field('consignee_name');
$show->field('consignee_telephone');
$show->field('consignee_zone');
$show->field('consignee_address');
$show->field('pay_info');
$show->field('pay_image');
$show->field('pay_time');
$show->field('paied_time');
$show->field('shipping_time');
$show->field('shippinged_time');
$show->field('created_at');
$show->field('updated_at');
});
return function (Row $row) use ($id) {
$row->column(5, function ($column) use ($id) {
});
};
}
/**

View File

@ -165,7 +165,7 @@ Route::group([
//经销商
$router->resource('dealer-products', 'DealerProductController')->names('dealer_products');
$router->resource('dealer-orders', 'DealerOrderController')->only([
'index', 'edit', 'update',
'index', 'show', 'edit', 'update',
])->names('dealer_orders');
$router->resource('dealer-users', 'DealerController')->only([
'index',

View File

@ -27,7 +27,7 @@ class ProductController extends Controller
public function show($id, Request $request)
{
$product = DealerProduct::with(['saleRules'])->online()->findOrFail($id);
$product = DealerProduct::with(['saleRules', 'lvlRules'])->online()->findOrFail($id);
return ProductResource::make($product);
}
}