Commit 99f65a05 by 孙龙

订单

parent 2921268a
Showing with 24 additions and 6 deletions
......@@ -3,6 +3,7 @@
namespace App\Admin\Controllers;
use App\Admin\Repositories\Order as OrderRepository;
use App\Models\Cms\CmsUser;
use App\Models\Order;
use Dcat\Admin\Form;
use Dcat\Admin\Grid;
......@@ -55,7 +56,7 @@ class OrderController extends AdminController
$grid->column('order_sn')->width('120px')->link(function () {
return admin_url('order_items/'.$this->order_id);
});
$grid->column('status')->using(admin_trans('order.options.status'));
$grid->column('status')->using(admin_trans('order.options.status'))->sortable();
$grid->column('company_name')->display(function ($company_name) {
return $company_name ? $company_name : "-";
});
......@@ -64,21 +65,38 @@ class OrderController extends AdminController
});
$grid->column('scmUser.name',admin_trans('scm-user.options.name'));
$grid->column('order_amount')->help('订单详情里-结算信息的“运费”“支付手续费”“其他费用”为空时;应付金额一栏为“待确认”');
$grid->column('order_pay_type')->using(admin_trans('order.options.order_pay_type'));
$grid->column('order_pay_type')->using(admin_trans('order.options.order_pay_type'))->sortable();
$grid->column('fukuanfangshi',"付款方式")->display(function () {
return "---不知道--";
});
$grid->column('sale_name');
$grid->column('order_remark');
$grid->column('update_time')->display(function ($update_time) {
$grid->column('order_remark')->limit(10);
$grid->column('update_time')->sortable()->display(function ($update_time) {
return intval($update_time) > 0 ? date("Y-m-d H:i:s",intval($update_time)) : "-";
});
$grid->column('create_time')->display(function ($create_time) {
$grid->column('create_time')->sortable()->display(function ($create_time) {
return intval($create_time) > 0 ? date("Y-m-d H:i:s",intval($create_time)) : "-";
});
$grid->showFilter();
$grid->disableActions();
$grid->filter(function (Grid\Filter $filter) {
$filter->equal('order_id');
$filter->expand(true);
$filter->whereBetween('create_time', function ($q) {
$start = strtotime($this->input['start'] ?? null);
$end = strtotime($this->input['end'] ?? null);
$q->whereBetween('create_time', [$start, $end]);
})->datetime()->width(3);
$filter->whereBetween('update_time', function ($q) {
$start = strtotime($this->input['start'] ?? null);
$end = strtotime($this->input['end'] ?? null);
$q->whereBetween('update_time', [$start, $end]);
})->datetime()->width(3);
$filter->startWith('company_name')->width(3);
$filter->startWith('scmUser.user_sn',admin_trans('scm-user.fields.user_sn'))->width(3);
$filter->equal('status')->select(admin_trans('order.options.status'))->width(3);
$filter->equal('sales_id',trans('inquiry.fields.sales_name'))->select(CmsUser::pluck('name', 'userId')->toArray())->width(3);
});
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment