Commit 5d9879bd by 孙龙

订单

parent 3795d857
......@@ -11,6 +11,8 @@ use Dcat\Admin\Http\Controllers\AdminController;
use Dcat\Admin\Layout\Content;
use Dcat\Admin\Layout\Column;
use Dcat\Admin\Layout\Row;
use Dcat\Admin\Admin;
class OrderController extends AdminController
......@@ -42,10 +44,38 @@ class OrderController extends AdminController
protected function grid()
{
return Grid::make(new Order(), function (Grid $grid) {
$grid->column('order_sn');
$grid->model()->with("scmUser")->orderBy('order_id', 'desc');
$grid->fixColumns(1,2);//固定列
$grid->showColumnSelector();//开启字段选择器功能
// 在 display 回调中使用
$grid->column('序号')->display(function () {
return $this->_index + 1;
});
$grid->column('order_id',"ID");
$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('company_name');
$grid->column('company_name');
$grid->column('company_name')->display(function ($company_name) {
return $company_name ? $company_name : "-";
});
$grid->column('scmUser.user_sn',admin_trans('scm-user.options.user_sn'))->link(function () {
return admin_url('smc_user/'.$this->user_id);
});
$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('fukuanfangshi',"付款方式")->display(function () {
return "---不知道--";
});
$grid->column('sale_name');
$grid->column('order_remark');
$grid->column('update_time')->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) {
return intval($create_time) > 0 ? date("Y-m-d H:i:s",intval($create_time)) : "-";
});
$grid->filter(function (Grid\Filter $filter) {
$filter->equal('order_id');
......
......@@ -18,9 +18,9 @@ class Order extends Model
public $timestamps = false;
public function user()
public function scmUser()
{
return $this->belongsTo(User::class, 'user_id', 'id');
return $this->belongsTo(ScmUser::class, 'user_id', 'id');
}
}
......@@ -19,5 +19,16 @@ return [
'sale_id' => '业务员id',
],
'options' => [
"status"=>[
"-1"=>"已取消",
"-2"=>"审核不通过",
"1"=>"待审核",
"2"=>"待付款",
"3"=>"待付尾款",
"4"=>"待发货",
"7"=>"部分发货",
"8"=>"待收货",
"10"=>" 交易成功",
],
],
];
......@@ -9,15 +9,17 @@ return [
'status' => '订单状态',
'order_remark' => '订单备注',
'company_name' => '公司名称',
'order_type' => '订单类型1网站 2ERP 3JD 4开放平台',
'order_type' => '订单类型',
'order_source' => '订单来源',
'order_pay_type' => '订单付款方式:1-全款支付,2-预付款支付,3-账期支付,4-预收自定义,5-预收50%',
'order_pay_type' => '付款类型',
'user_id' => '用户ID',
'order_amount' => '订单金额',
'advance_amount' => '预付款金额,预付款时默认订单金额30%',
'currency' => '币种1CNY 2USD',
'create_time' => '订单创建时间',
'create_time' => '下单时间',
'update_time' => '更新时间',
'sale_id' => '业务员id',
'sale_name' => '业务员',
],
'options' => [
"status"=>[
......@@ -31,5 +33,12 @@ return [
"8"=>"待收货",
"10"=>" 交易成功",
],
"order_pay_type"=>[
"1"=>"全款支付",
"2"=>"预付款支付",
"3"=>"账期支付",
"4"=>"预收自定义",
"5"=>"预收50%",
],
],
];
......@@ -6,6 +6,7 @@ return [
],
'fields' => [
'name' => '用户名',
'user_sn' => '客户编码',
'email' => '邮箱',
'email_verified_at' => '邮箱校验时间',
'password' => '密码',
......
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