添加后台售后记录查询
parent
03cba58d9c
commit
6520374a5a
|
|
@ -0,0 +1,108 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Controllers;
|
||||
|
||||
use App\Admin\Repositories\OrderRefundLog;
|
||||
use Dcat\Admin\Admin;
|
||||
use Dcat\Admin\Form;
|
||||
use Dcat\Admin\Grid;
|
||||
use Dcat\Admin\Grid\Column;
|
||||
use Dcat\Admin\Http\Controllers\AdminController;
|
||||
use Dcat\Admin\Show;
|
||||
|
||||
class OrderRefundLogController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Make a grid builder.
|
||||
*
|
||||
* @return Grid
|
||||
*/
|
||||
protected function grid()
|
||||
{
|
||||
$builder = OrderRefundLog::with(['order', 'afterSale']);
|
||||
return Grid::make($builder, function (Grid $grid) {
|
||||
$grid->column('id')->sortable();
|
||||
$grid->column('sn');
|
||||
$grid->column('order.sn')->if(function () {
|
||||
return Admin::user()->can('dcat.admin.orders.show');
|
||||
})
|
||||
->then(function (Column $column) {
|
||||
$column->link(function ($value) {
|
||||
return admin_url('orders/'.$this->order_id);
|
||||
});
|
||||
})
|
||||
->else(function (Column $column) {
|
||||
$column->copyable();
|
||||
});
|
||||
$grid->column('afterSale.sn')->if(function () {
|
||||
return Admin::user()->can('dcat.admin.after-sales.show');
|
||||
})
|
||||
->then(function (Column $column) {
|
||||
$column->link(function ($value) {
|
||||
return admin_url('after-sales/'.$this->after_sale_id);
|
||||
});
|
||||
})
|
||||
->else(function (Column $column) {
|
||||
$column->copyable();
|
||||
});
|
||||
$grid->column('amount');
|
||||
$grid->column('status');
|
||||
$grid->column('reason');
|
||||
$grid->column('failed_reason');
|
||||
$grid->column('created_at');
|
||||
$grid->column('updated_at')->sortable();
|
||||
|
||||
$grid->filter(function (Grid\Filter $filter) {
|
||||
$filter->panel();
|
||||
$filter->equal('sn')->width(3);
|
||||
$filter->equal('order.sn')->width(3);
|
||||
$filter->equal('afterSale.sn')->width(3);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a show builder.
|
||||
*
|
||||
* @param mixed $id
|
||||
*
|
||||
* @return Show
|
||||
*/
|
||||
protected function detail($id)
|
||||
{
|
||||
return Show::make($id, new OrderRefundLog(), function (Show $show) {
|
||||
$show->field('id');
|
||||
$show->field('sn');
|
||||
$show->field('order_id');
|
||||
$show->field('after_sale_id');
|
||||
$show->field('amount');
|
||||
$show->field('status');
|
||||
$show->field('reason');
|
||||
$show->field('failed_reason');
|
||||
$show->field('created_at');
|
||||
$show->field('updated_at');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a form builder.
|
||||
*
|
||||
* @return Form
|
||||
*/
|
||||
protected function form()
|
||||
{
|
||||
return Form::make(new OrderRefundLog(), function (Form $form) {
|
||||
$form->display('id');
|
||||
$form->text('sn');
|
||||
$form->text('order_id');
|
||||
$form->text('after_sale_id');
|
||||
$form->text('amount');
|
||||
$form->text('status');
|
||||
$form->text('reason');
|
||||
$form->text('failed_reason');
|
||||
|
||||
$form->display('created_at');
|
||||
$form->display('updated_at');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Repositories;
|
||||
|
||||
use App\Models\OrderRefundLog as Model;
|
||||
use Dcat\Admin\Repositories\EloquentRepository;
|
||||
|
||||
class OrderRefundLog extends EloquentRepository
|
||||
{
|
||||
/**
|
||||
* Model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $eloquentClass = Model::class;
|
||||
}
|
||||
|
|
@ -151,6 +151,10 @@ Route::group([
|
|||
])->names('quota_v1_send_jobs');
|
||||
$router->get('quota-v1-send-jobs/{job}/log-list', 'QuotaV1SendJobController@logList')->name('quota_v1_send_jobs.log_list');
|
||||
|
||||
$router->resource('order-refunds', 'OrderRefundLogController')->only([
|
||||
'index',
|
||||
])->names('order_refund');
|
||||
|
||||
/** api接口 **/
|
||||
$router->get('api/product-categories', 'ProductCategoryController@categories')->name('api.product_categories');
|
||||
$router->get('api/product-group-details', 'ProductGroupController@details')->name('api.product_group_details');
|
||||
|
|
|
|||
|
|
@ -54,4 +54,9 @@ class OrderRefundLog extends Model
|
|||
{
|
||||
return $this->belongsTo(Order::class);
|
||||
}
|
||||
|
||||
public function afterSale()
|
||||
{
|
||||
return $this->belongsTo(AfterSale::class);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -181,6 +181,11 @@ class AdminMenuSeeder extends Seeder
|
|||
'icon' => '',
|
||||
'uri'=>'order-reduce-ranges',
|
||||
],
|
||||
[
|
||||
'title' =>'退款记录',
|
||||
'icon' => '',
|
||||
'uri' => 'order-refunds',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
|
|
|
|||
|
|
@ -128,9 +128,9 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection failed_at
|
||||
* @property Grid\Column|Collection code
|
||||
* @property Grid\Column|Collection info
|
||||
* @property Grid\Column|Collection message_id
|
||||
* @property Grid\Column|Collection ext
|
||||
* @property Grid\Column|Collection is_push
|
||||
* @property Grid\Column|Collection message_id
|
||||
* @property Grid\Column|Collection order_package_id
|
||||
* @property Grid\Column|Collection quantity
|
||||
* @property Grid\Column|Collection consignee_name
|
||||
|
|
@ -201,12 +201,14 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection message_type
|
||||
* @property Grid\Column|Collection change_quota
|
||||
* @property Grid\Column|Collection job_id
|
||||
* @property Grid\Column|Collection order_user_id
|
||||
* @property Grid\Column|Collection x
|
||||
* @property Grid\Column|Collection y
|
||||
* @property Grid\Column|Collection size
|
||||
* @property Grid\Column|Collection is_use
|
||||
* @property Grid\Column|Collection rule_id
|
||||
* @property Grid\Column|Collection template_id
|
||||
* @property Grid\Column|Collection zones
|
||||
* @property Grid\Column|Collection phone
|
||||
* @property Grid\Column|Collection expires_at
|
||||
* @property Grid\Column|Collection tag_id
|
||||
|
|
@ -245,6 +247,7 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection last_login_at
|
||||
* @property Grid\Column|Collection register_ip
|
||||
* @property Grid\Column|Collection status_remark
|
||||
* @property Grid\Column|Collection old_password
|
||||
* @property Grid\Column|Collection rate
|
||||
* @property Grid\Column|Collection service_amount
|
||||
* @property Grid\Column|Collection account_amount
|
||||
|
|
@ -367,9 +370,9 @@ namespace Dcat\Admin {
|
|||
* @method Grid\Column|Collection failed_at(string $label = null)
|
||||
* @method Grid\Column|Collection code(string $label = null)
|
||||
* @method Grid\Column|Collection info(string $label = null)
|
||||
* @method Grid\Column|Collection message_id(string $label = null)
|
||||
* @method Grid\Column|Collection ext(string $label = null)
|
||||
* @method Grid\Column|Collection is_push(string $label = null)
|
||||
* @method Grid\Column|Collection message_id(string $label = null)
|
||||
* @method Grid\Column|Collection order_package_id(string $label = null)
|
||||
* @method Grid\Column|Collection quantity(string $label = null)
|
||||
* @method Grid\Column|Collection consignee_name(string $label = null)
|
||||
|
|
@ -440,12 +443,14 @@ namespace Dcat\Admin {
|
|||
* @method Grid\Column|Collection message_type(string $label = null)
|
||||
* @method Grid\Column|Collection change_quota(string $label = null)
|
||||
* @method Grid\Column|Collection job_id(string $label = null)
|
||||
* @method Grid\Column|Collection order_user_id(string $label = null)
|
||||
* @method Grid\Column|Collection x(string $label = null)
|
||||
* @method Grid\Column|Collection y(string $label = null)
|
||||
* @method Grid\Column|Collection size(string $label = null)
|
||||
* @method Grid\Column|Collection is_use(string $label = null)
|
||||
* @method Grid\Column|Collection rule_id(string $label = null)
|
||||
* @method Grid\Column|Collection template_id(string $label = null)
|
||||
* @method Grid\Column|Collection zones(string $label = null)
|
||||
* @method Grid\Column|Collection phone(string $label = null)
|
||||
* @method Grid\Column|Collection expires_at(string $label = null)
|
||||
* @method Grid\Column|Collection tag_id(string $label = null)
|
||||
|
|
@ -484,6 +489,7 @@ namespace Dcat\Admin {
|
|||
* @method Grid\Column|Collection last_login_at(string $label = null)
|
||||
* @method Grid\Column|Collection register_ip(string $label = null)
|
||||
* @method Grid\Column|Collection status_remark(string $label = null)
|
||||
* @method Grid\Column|Collection old_password(string $label = null)
|
||||
* @method Grid\Column|Collection rate(string $label = null)
|
||||
* @method Grid\Column|Collection service_amount(string $label = null)
|
||||
* @method Grid\Column|Collection account_amount(string $label = null)
|
||||
|
|
@ -611,9 +617,9 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection failed_at
|
||||
* @property Show\Field|Collection code
|
||||
* @property Show\Field|Collection info
|
||||
* @property Show\Field|Collection message_id
|
||||
* @property Show\Field|Collection ext
|
||||
* @property Show\Field|Collection is_push
|
||||
* @property Show\Field|Collection message_id
|
||||
* @property Show\Field|Collection order_package_id
|
||||
* @property Show\Field|Collection quantity
|
||||
* @property Show\Field|Collection consignee_name
|
||||
|
|
@ -684,12 +690,14 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection message_type
|
||||
* @property Show\Field|Collection change_quota
|
||||
* @property Show\Field|Collection job_id
|
||||
* @property Show\Field|Collection order_user_id
|
||||
* @property Show\Field|Collection x
|
||||
* @property Show\Field|Collection y
|
||||
* @property Show\Field|Collection size
|
||||
* @property Show\Field|Collection is_use
|
||||
* @property Show\Field|Collection rule_id
|
||||
* @property Show\Field|Collection template_id
|
||||
* @property Show\Field|Collection zones
|
||||
* @property Show\Field|Collection phone
|
||||
* @property Show\Field|Collection expires_at
|
||||
* @property Show\Field|Collection tag_id
|
||||
|
|
@ -728,6 +736,7 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection last_login_at
|
||||
* @property Show\Field|Collection register_ip
|
||||
* @property Show\Field|Collection status_remark
|
||||
* @property Show\Field|Collection old_password
|
||||
* @property Show\Field|Collection rate
|
||||
* @property Show\Field|Collection service_amount
|
||||
* @property Show\Field|Collection account_amount
|
||||
|
|
@ -850,9 +859,9 @@ namespace Dcat\Admin {
|
|||
* @method Show\Field|Collection failed_at(string $label = null)
|
||||
* @method Show\Field|Collection code(string $label = null)
|
||||
* @method Show\Field|Collection info(string $label = null)
|
||||
* @method Show\Field|Collection message_id(string $label = null)
|
||||
* @method Show\Field|Collection ext(string $label = null)
|
||||
* @method Show\Field|Collection is_push(string $label = null)
|
||||
* @method Show\Field|Collection message_id(string $label = null)
|
||||
* @method Show\Field|Collection order_package_id(string $label = null)
|
||||
* @method Show\Field|Collection quantity(string $label = null)
|
||||
* @method Show\Field|Collection consignee_name(string $label = null)
|
||||
|
|
@ -923,12 +932,14 @@ namespace Dcat\Admin {
|
|||
* @method Show\Field|Collection message_type(string $label = null)
|
||||
* @method Show\Field|Collection change_quota(string $label = null)
|
||||
* @method Show\Field|Collection job_id(string $label = null)
|
||||
* @method Show\Field|Collection order_user_id(string $label = null)
|
||||
* @method Show\Field|Collection x(string $label = null)
|
||||
* @method Show\Field|Collection y(string $label = null)
|
||||
* @method Show\Field|Collection size(string $label = null)
|
||||
* @method Show\Field|Collection is_use(string $label = null)
|
||||
* @method Show\Field|Collection rule_id(string $label = null)
|
||||
* @method Show\Field|Collection template_id(string $label = null)
|
||||
* @method Show\Field|Collection zones(string $label = null)
|
||||
* @method Show\Field|Collection phone(string $label = null)
|
||||
* @method Show\Field|Collection expires_at(string $label = null)
|
||||
* @method Show\Field|Collection tag_id(string $label = null)
|
||||
|
|
@ -967,6 +978,7 @@ namespace Dcat\Admin {
|
|||
* @method Show\Field|Collection last_login_at(string $label = null)
|
||||
* @method Show\Field|Collection register_ip(string $label = null)
|
||||
* @method Show\Field|Collection status_remark(string $label = null)
|
||||
* @method Show\Field|Collection old_password(string $label = null)
|
||||
* @method Show\Field|Collection rate(string $label = null)
|
||||
* @method Show\Field|Collection service_amount(string $label = null)
|
||||
* @method Show\Field|Collection account_amount(string $label = null)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'labels' => [
|
||||
'OrderRefundLog' => '退款记录',
|
||||
'order-refund-log' => '退款记录',
|
||||
],
|
||||
'fields' => [
|
||||
'sn' => '退款流水号',
|
||||
'order_id' => '订单',
|
||||
'order' => [
|
||||
'sn'=>'订单编号',
|
||||
],
|
||||
'after_sale_id' => '售后订单',
|
||||
'afterSale' => [
|
||||
'sn'=>'售后编号',
|
||||
],
|
||||
'amount' => '退款金额',
|
||||
'status' => '状态',
|
||||
'reason' => '退款原因',
|
||||
'failed_reason' => '失败原因',
|
||||
],
|
||||
'options' => [
|
||||
],
|
||||
];
|
||||
Loading…
Reference in New Issue