Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
semour
/
semour_admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ecfb1977
authored
Nov 18, 2022
by
孙龙
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' of
http://git.ichunt.net/semour/semour_admin
parents
94fc9893
5fc9a79d
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
20 additions
and
20 deletions
app/Admin/Controllers/ScmUserController.php
app/Admin/Service/UserService.php
app/Models/User.php
database/migrations/2014_10_12_000000_create_users_table.php
database/migrations/2022_10_31_074424_create_user_address_table.php
database/migrations/2022_10_31_081806_create_frq_table.php
resources/lang/en/scm-user.php
resources/lang/en/user.php
resources/lang/zh_CN/scm-user.php
resources/lang/zh_CN/user.php
app/Admin/Controllers/ScmUserController.php
View file @
ecfb1977
...
...
@@ -30,14 +30,14 @@ class ScmUserController extends AdminController
$grid
->
column
(
'company_name'
);
$grid
->
column
(
'first_name'
);
$grid
->
column
(
'last_name'
);
$grid
->
column
(
'create
d
_time'
);
$grid
->
column
(
'create_time'
);
$grid
->
column
(
'update_time'
);
$grid
->
column
(
'created_at'
);
$grid
->
column
(
'updated_at'
)
->
sortable
();
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
$filter
->
equal
(
'id'
);
});
});
}
...
...
@@ -64,7 +64,7 @@ class ScmUserController extends AdminController
$show
->
field
(
'company_name'
);
$show
->
field
(
'first_name'
);
$show
->
field
(
'last_name'
);
$show
->
field
(
'create
d
_time'
);
$show
->
field
(
'create_time'
);
$show
->
field
(
'update_time'
);
$show
->
field
(
'created_at'
);
$show
->
field
(
'updated_at'
);
...
...
@@ -91,9 +91,9 @@ class ScmUserController extends AdminController
$form
->
text
(
'company_name'
);
$form
->
text
(
'first_name'
);
$form
->
text
(
'last_name'
);
$form
->
text
(
'create
d
_time'
);
$form
->
text
(
'create_time'
);
$form
->
text
(
'update_time'
);
$form
->
display
(
'created_at'
);
$form
->
display
(
'updated_at'
);
});
...
...
app/Admin/Service/UserService.php
View file @
ecfb1977
...
...
@@ -23,10 +23,10 @@ class UserService
{
$grid
->
filter
(
function
(
$filter
)
{
$filter
->
expand
(
true
);
$filter
->
whereBetween
(
'create
d
_time'
,
function
(
$q
)
{
$filter
->
whereBetween
(
'create_time'
,
function
(
$q
)
{
$start
=
strtotime
(
$this
->
input
[
'start'
]
??
null
);
$end
=
strtotime
(
$this
->
input
[
'end'
]
??
null
);
$q
->
whereBetween
(
'create
d
_time'
,
[
$start
,
$end
]);
$q
->
whereBetween
(
'create_time'
,
[
$start
,
$end
]);
})
->
datetime
()
->
width
(
3
);
$filter
->
startWith
(
'company_name'
)
->
width
(
2
);
...
...
@@ -64,7 +64,7 @@ class UserService
];
return
"
{
$data
[
'pending'
]
}
/
{
$data
[
'all'
]
}
"
;
});
$grid
->
column
(
'create
d
_time'
)
->
display
(
function
(
$time
)
{
$grid
->
column
(
'create_time'
)
->
display
(
function
(
$time
)
{
return
$time
?
date
(
'Y-m-d H:i:s'
,
$time
)
:
''
;
})
->
sortable
();;
$grid
->
column
(
'status'
)
->
using
(
admin_trans
(
'user.options.status'
));
...
...
@@ -92,7 +92,7 @@ class UserService
// $rowArray = $actions->row->toArray();
// 获取当前行主键值
$id
=
$actions
->
getKey
();
$actions
->
append
(
'<a style="margin-right: 5px" href="'
.
admin_url
(
"/users/
{
$id
}
"
)
.
'" class="btn btn-primary btn-sm
$actions
->
append
(
'<a style="margin-right: 5px" href="'
.
admin_url
(
"/users/
{
$id
}
"
)
.
'" class="btn btn-primary btn-sm
btn-mini">'
.
admin_trans
(
"detail"
)
.
'</a>'
);
//状态按钮
$actions
->
append
(
new
UserStatusAction
());
...
...
@@ -125,7 +125,7 @@ class UserService
"status"
=>
User
::
STATUS_NORMAL
,
"sale_id"
=>
request
()
->
user
->
userId
??
"1000"
,
"sale_name"
=>
request
()
->
user
->
name
??
"admin"
,
"create
d
_time"
=>
time
(),
"create_time"
=>
time
(),
"update_time"
=>
time
(),
];
$userId
=
User
::
insertData
(
$userData
);
...
...
app/Models/User.php
View file @
ecfb1977
...
...
@@ -23,7 +23,7 @@ use Illuminate\Database\Eloquent\Model;
* @property $sale_id 业务员
* @property $sale_name 业务员名字
* @property $last_name 姓氏
* @property $create
d
_time 创建时间
* @property $create_time 创建时间
* @property $update_time 更新时间
*/
class
User
extends
BaseModel
...
...
database/migrations/2014_10_12_000000_create_users_table.php
View file @
ecfb1977
...
...
@@ -26,7 +26,7 @@ class CreateUsersTable extends Migration
$table
->
string
(
'company_name'
,
100
)
->
comment
(
'公司名称'
)
->
default
(
''
);
$table
->
string
(
'first_name'
,
100
)
->
comment
(
'名字'
)
->
default
(
''
);
$table
->
string
(
'last_name'
,
100
)
->
comment
(
'姓氏'
)
->
default
(
''
);
$table
->
integer
(
'create
d
_time'
)
->
unsigned
()
->
comment
(
'创建时间'
)
->
default
(
0
);
$table
->
integer
(
'create_time'
)
->
unsigned
()
->
comment
(
'创建时间'
)
->
default
(
0
);
$table
->
integer
(
'update_time'
)
->
unsigned
()
->
comment
(
'更新时间'
)
->
default
(
0
);
});
}
...
...
database/migrations/2022_10_31_074424_create_user_address_table.php
View file @
ecfb1977
...
...
@@ -27,7 +27,7 @@ class CreateUserAddressTable extends Migration
$table
->
string
(
'postal_code'
,
50
)
->
comment
(
'邮政编码'
)
->
default
(
''
);
$table
->
string
(
'address'
,
255
)
->
comment
(
'具体地址'
)
->
default
(
''
);
$table
->
tinyInteger
(
'is_default'
)
->
comment
(
'是否是默认地址,1是,-1否'
)
->
default
(
-
1
);
$table
->
integer
(
'create
d
_time'
)
->
unsigned
()
->
comment
(
'创建时间'
)
->
default
(
0
);
$table
->
integer
(
'create_time'
)
->
unsigned
()
->
comment
(
'创建时间'
)
->
default
(
0
);
$table
->
integer
(
'update_time'
)
->
unsigned
()
->
comment
(
'更新时间'
)
->
default
(
0
);
});
}
...
...
database/migrations/2022_10_31_081806_create_frq_table.php
View file @
ecfb1977
...
...
@@ -22,7 +22,7 @@ class CreateFrqTable extends Migration
$table
->
integer
(
'quantity'
)
->
unsigned
()
->
comment
(
'数量'
)
->
default
(
0
);
$table
->
string
(
'remark'
)
->
comment
(
'备注'
)
->
default
(
''
);
$table
->
tinyInteger
(
'status'
)
->
unsigned
()
->
comment
(
'询价状态,1是进行中,2是已回复'
)
->
default
(
1
);
$table
->
integer
(
'create
d
_time'
)
->
unsigned
()
->
comment
(
'创建时间'
)
->
default
(
0
);
$table
->
integer
(
'create_time'
)
->
unsigned
()
->
comment
(
'创建时间'
)
->
default
(
0
);
$table
->
integer
(
'update_time'
)
->
unsigned
()
->
comment
(
'更新时间'
)
->
default
(
0
);
});
}
...
...
resources/lang/en/scm-user.php
View file @
ecfb1977
...
...
@@ -17,7 +17,7 @@ return [
'company_name'
=>
'公司名称'
,
'first_name'
=>
'名字'
,
'last_name'
=>
'姓氏'
,
'create
d
_time'
=>
'创建时间'
,
'create_time'
=>
'创建时间'
,
'update_time'
=>
'更新时间'
,
],
'options'
=>
[
...
...
resources/lang/en/user.php
View file @
ecfb1977
...
...
@@ -25,7 +25,7 @@ return [
'sale_id'
=>
'业务员'
,
'sale_name'
=>
'业务员名字'
,
'last_name'
=>
'姓氏'
,
'create
d
_time'
=>
'创建时间'
,
'create_time'
=>
'创建时间'
,
'update_time'
=>
'更新时间'
,
'reg_source'
=>
'注册来源'
,
'order_num_data'
=>
'进行中 / 总计 订单数'
,
...
...
resources/lang/zh_CN/scm-user.php
View file @
ecfb1977
<?php
<?php
return
[
'labels'
=>
[
'ScmUser'
=>
'ScmUser'
,
...
...
@@ -17,7 +17,7 @@ return [
'company_name'
=>
'公司名称'
,
'first_name'
=>
'名字'
,
'last_name'
=>
'姓氏'
,
'create
d
_time'
=>
'创建时间'
,
'create_time'
=>
'创建时间'
,
'update_time'
=>
'更新时间'
,
],
'options'
=>
[
...
...
resources/lang/zh_CN/user.php
View file @
ecfb1977
...
...
@@ -20,7 +20,7 @@ return [
'sale_id'
=>
'业务员'
,
'sale_name'
=>
'业务员名字'
,
'last_name'
=>
'姓氏'
,
'create
d
_time'
=>
'创建时间'
,
'create_time'
=>
'创建时间'
,
'update_time'
=>
'更新时间'
,
],
'options'
=>
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment