Commit 9a212bf4 by 杨树贤

Merge branch 'master' of http://119.23.72.7/semour/semour_admin

parents c37574b8 3795d857
<?php
namespace App\Admin\Controllers;
use App\Admin\Repositories\Order as OrderRepository;
use App\Models\Order;
use Dcat\Admin\Form;
use Dcat\Admin\Grid;
use Dcat\Admin\Show;
use Dcat\Admin\Http\Controllers\AdminController;
use Dcat\Admin\Layout\Content;
use Dcat\Admin\Layout\Column;
use Dcat\Admin\Layout\Row;
class OrderController extends AdminController
{
/**
* Index interface.
*
* @param Content $content
* @return Content
*/
public function index(Content $content)
{
return $content
->translation($this->translation())
->title($this->title())
->description($this->description()['index'] ?? trans('admin.list'))
->body($this->grid());
}
/**
* Make a grid builder.
*
* @return Grid
*/
protected function grid()
{
return Grid::make(new Order(), function (Grid $grid) {
$grid->column('order_sn');
$grid->column('status')->using(admin_trans('order.options.status'));
$grid->column('company_name');
$grid->column('company_name');
$grid->filter(function (Grid\Filter $filter) {
$filter->equal('order_id');
});
});
}
/**
* Make a show builder.
*
* @param mixed $id
*
* @return Show
*/
protected function detail($id)
{
return Show::make($id, new Order(), function (Show $show) {
$show->field('order_id');
$show->field('order_sn');
$show->field('order_remark');
$show->field('company_name');
$show->field('order_type');
$show->field('order_source');
$show->field('order_pay_type');
$show->field('user_id');
$show->field('order_amount');
$show->field('advance_amount');
$show->field('currency');
$show->field('create_time');
$show->field('sale_id');
});
}
/**
* Make a form builder.
*
* @return Form
*/
protected function form()
{
return Form::make(new Order(), function (Form $form) {
$form->display('order_id');
$form->text('order_sn');
$form->text('order_remark');
$form->text('company_name');
$form->text('order_type');
$form->text('order_source');
$form->text('order_pay_type');
$form->text('user_id');
$form->text('order_amount');
$form->text('advance_amount');
$form->text('currency');
$form->text('create_time');
$form->text('sale_id');
});
}
}
<?php
namespace App\Admin\Controllers;
use App\Admin\Repositories\OrderItem;
use Dcat\Admin\Form;
use Dcat\Admin\Grid;
use Dcat\Admin\Show;
use Dcat\Admin\Http\Controllers\AdminController;
class OrderItemController extends AdminController
{
/**
* Make a grid builder.
*
* @return Grid
*/
protected function grid()
{
return Grid::make(new OrderItem(), function (Grid $grid) {
$grid->column('rec_id')->sortable();
$grid->column('order_id');
$grid->column('user_id');
$grid->column('goods_id');
$grid->column('supplier_id');
$grid->column('brand_id');
$grid->column('standard_brand_id');
$grid->column('goods_name');
$grid->column('supplier_name');
$grid->column('brand_name');
$grid->column('standard_brand_name');
$grid->column('goods_type');
$grid->column('goods_number');
$grid->column('goods_price');
$grid->column('delivery_time');
$grid->column('canal');
$grid->column('status');
$grid->column('initial_price');
$grid->column('purchase_uid');
$grid->column('contract_remark');
$grid->column('tax_rate');
$grid->filter(function (Grid\Filter $filter) {
$filter->equal('rec_id');
});
});
}
/**
* Make a show builder.
*
* @param mixed $id
*
* @return Show
*/
protected function detail($id)
{
return Show::make($id, new OrderItem(), function (Show $show) {
$show->field('rec_id');
$show->field('order_id');
$show->field('user_id');
$show->field('goods_id');
$show->field('supplier_id');
$show->field('brand_id');
$show->field('standard_brand_id');
$show->field('goods_name');
$show->field('supplier_name');
$show->field('brand_name');
$show->field('standard_brand_name');
$show->field('goods_type');
$show->field('goods_number');
$show->field('goods_price');
$show->field('delivery_time');
$show->field('canal');
$show->field('status');
$show->field('initial_price');
$show->field('purchase_uid');
$show->field('contract_remark');
$show->field('tax_rate');
});
}
/**
* Make a form builder.
*
* @return Form
*/
protected function form()
{
return Form::make(new OrderItem(), function (Form $form) {
$form->display('rec_id');
$form->text('order_id');
$form->text('user_id');
$form->text('goods_id');
$form->text('supplier_id');
$form->text('brand_id');
$form->text('standard_brand_id');
$form->text('goods_name');
$form->text('supplier_name');
$form->text('brand_name');
$form->text('standard_brand_name');
$form->text('goods_type');
$form->text('goods_number');
$form->text('goods_price');
$form->text('delivery_time');
$form->text('canal');
$form->text('status');
$form->text('initial_price');
$form->text('purchase_uid');
$form->text('contract_remark');
$form->text('tax_rate');
});
}
}
<?php
namespace App\Admin\Controllers;
use App\Admin\Repositories\ScmUser;
use Dcat\Admin\Form;
use Dcat\Admin\Grid;
use Dcat\Admin\Show;
use Dcat\Admin\Http\Controllers\AdminController;
class ScmUserController extends AdminController
{
/**
* Make a grid builder.
*
* @return Grid
*/
protected function grid()
{
return Grid::make(new ScmUser(), function (Grid $grid) {
$grid->column('id')->sortable();
$grid->column('name');
$grid->column('email');
$grid->column('email_verified_at');
$grid->column('password');
$grid->column('phone');
$grid->column('remember_token');
$grid->column('account_properties');
$grid->column('status');
$grid->column('company_name');
$grid->column('first_name');
$grid->column('last_name');
$grid->column('created_time');
$grid->column('update_time');
$grid->column('created_at');
$grid->column('updated_at')->sortable();
$grid->filter(function (Grid\Filter $filter) {
$filter->equal('id');
});
});
}
/**
* Make a show builder.
*
* @param mixed $id
*
* @return Show
*/
protected function detail($id)
{
return Show::make($id, new ScmUser(), function (Show $show) {
$show->field('id');
$show->field('name');
$show->field('email');
$show->field('email_verified_at');
$show->field('password');
$show->field('phone');
$show->field('remember_token');
$show->field('account_properties');
$show->field('status');
$show->field('company_name');
$show->field('first_name');
$show->field('last_name');
$show->field('created_time');
$show->field('update_time');
$show->field('created_at');
$show->field('updated_at');
});
}
/**
* Make a form builder.
*
* @return Form
*/
protected function form()
{
return Form::make(new ScmUser(), function (Form $form) {
$form->display('id');
$form->text('name');
$form->text('email');
$form->text('email_verified_at');
$form->text('password');
$form->text('phone');
$form->text('remember_token');
$form->text('account_properties');
$form->text('status');
$form->text('company_name');
$form->text('first_name');
$form->text('last_name');
$form->text('created_time');
$form->text('update_time');
$form->display('created_at');
$form->display('updated_at');
});
}
}
<?php
namespace App\Admin\Repositories;
use App\Models\Inquiry as Model;
use Dcat\Admin\Repositories\EloquentRepository;
class Order extends EloquentRepository
{
/**
* Model.
*
* @var string
*/
protected $eloquentClass = \App\Models\Order::class;
}
<?php
namespace App\Admin\Repositories;
use App\Models\OrderItem as Model;
use Dcat\Admin\Repositories\EloquentRepository;
class OrderItem extends EloquentRepository
{
/**
* Model.
*
* @var string
*/
protected $eloquentClass = Model::class;
}
<?php
namespace App\Admin\Repositories;
use App\Models\ScmUser as Model;
use Dcat\Admin\Repositories\EloquentRepository;
class ScmUser extends EloquentRepository
{
/**
* Model.
*
* @var string
*/
protected $eloquentClass = Model::class;
}
...@@ -15,6 +15,7 @@ Route::group([ ...@@ -15,6 +15,7 @@ Route::group([
$router->get('/', 'HomeController@index'); $router->get('/', 'HomeController@index');
$router->resource('userAddress', 'UserAddressController'); $router->resource('userAddress', 'UserAddressController');
$router->resource('inquiry', 'InquiryController'); $router->resource('inquiry', 'InquiryController');
$router->resource('order', 'OrderController');
$router->resource('test', 'TestController'); $router->resource('test', 'TestController');
}); });
<?php
namespace App\Models;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;
class Order extends Model
{
use HasDateTimeFormatter;
protected $table = 'order';
protected $primaryKey = 'order_id';
public $timestamps = false;
public function user()
{
return $this->belongsTo(User::class, 'user_id', 'id');
}
}
<?php
namespace App\Models;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;
class OrderItem extends Model
{
use HasDateTimeFormatter;
protected $table = 'order_items';
protected $primaryKey = 'rec_id';
public $timestamps = false;
}
<?php
namespace App\Models;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;
class ScmUser extends Model
{
use HasDateTimeFormatter;
protected $table = 'users';
protected $primaryKey = 'id';
public $timestamps = false;
}
File mode changed
<?php
return [
'labels' => [
'Order' => 'Order',
'order' => 'Order',
],
'fields' => [
'order_sn' => '订单编号号',
'order_remark' => '订单备注',
'company_name' => '公司名称',
'order_type' => '订单类型1网站 2ERP 3JD 4开放平台',
'order_source' => '订单来源',
'order_pay_type' => '订单付款方式:1-全款支付,2-预付款支付,3-账期支付,4-预收自定义,5-预收50%',
'user_id' => '用户ID',
'order_amount' => '订单金额',
'advance_amount' => '预付款金额,预付款时默认订单金额30%',
'currency' => '币种1CNY 2USD',
'create_time' => '订单创建时间',
'sale_id' => '业务员id',
],
'options' => [
],
];
<?php
return [
'labels' => [
'OrderItem' => 'OrderItem',
'order-item' => 'OrderItem',
],
'fields' => [
'order_id' => '订单ID',
'user_id' => '用户ID',
'goods_id' => '商品ID',
'supplier_id' => '供应商ID(=company_id)',
'brand_id' => '品牌ID',
'standard_brand_id' => '标准品牌ID',
'goods_name' => '型号',
'supplier_name' => '供应商名(=company_name)',
'brand_name' => '品牌名',
'standard_brand_name' => '标准品牌',
'goods_type' => '商品类型 联营:1专卖2联营 自营 :3自营 4寄售 5第三方仓库',
'goods_number' => '购买数量',
'goods_price' => '商品单价',
'delivery_time' => '交货时间',
'canal' => '渠道标签',
'status' => '状态 -1已删除 1正常',
'initial_price' => '原始销售价格',
'purchase_uid' => '采购员id(内部账户系统id)',
'contract_remark' => '合同备注 6个汉子',
'tax_rate' => '税率',
],
'options' => [
],
];
<?php
return [
'labels' => [
'Order' => 'Order',
'order' => 'Order',
],
'fields' => [
'order_sn' => '订单编号号',
'status' => '订单状态',
'order_remark' => '订单备注',
'company_name' => '公司名称',
'order_type' => '订单类型1网站 2ERP 3JD 4开放平台',
'order_source' => '订单来源',
'order_pay_type' => '订单付款方式:1-全款支付,2-预付款支付,3-账期支付,4-预收自定义,5-预收50%',
'user_id' => '用户ID',
'order_amount' => '订单金额',
'advance_amount' => '预付款金额,预付款时默认订单金额30%',
'currency' => '币种1CNY 2USD',
'create_time' => '订单创建时间',
'sale_id' => '业务员id',
],
'options' => [
"status"=>[
"-1"=>"已取消",
"-2"=>"审核不通过",
"1"=>"待审核",
"2"=>"待付款",
"3"=>"待付尾款",
"4"=>"待发货",
"7"=>"部分发货",
"8"=>"待收货",
"10"=>" 交易成功",
],
],
];
<?php
return [
'labels' => [
'ScmUser' => 'ScmUser',
'scm-user' => 'ScmUser',
],
'fields' => [
'name' => '用户名',
'email' => '邮箱',
'email_verified_at' => '邮箱校验时间',
'password' => '密码',
'phone' => '手机号码',
'remember_token' => '记住登陆token',
'account_properties' => '账号属性,1是个人,2是企业',
'status' => '状态,1是正常,-1是禁用',
'company_name' => '公司名称',
'first_name' => '名字',
'last_name' => '姓氏',
'created_time' => '创建时间',
'update_time' => '更新时间',
],
'options' => [
],
];
<?php
return [
'labels' => [
'Order' => 'Order',
'order' => 'Order',
],
'fields' => [
'order_sn' => '订单编号号',
'order_remark' => '订单备注',
'company_name' => '公司名称',
'order_type' => '订单类型1网站 2ERP 3JD 4开放平台',
'order_source' => '订单来源',
'order_pay_type' => '订单付款方式:1-全款支付,2-预付款支付,3-账期支付,4-预收自定义,5-预收50%',
'user_id' => '用户ID',
'order_amount' => '订单金额',
'advance_amount' => '预付款金额,预付款时默认订单金额30%',
'currency' => '币种1CNY 2USD',
'create_time' => '订单创建时间',
'sale_id' => '业务员id',
],
'options' => [
],
];
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