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
3f7169f3
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
74e7f2b5
c6e8af7f
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
176 additions
and
22 deletions
app/Admin/Controllers/InquiryController.php
app/Admin/Forms/HandleInquiry.php
app/Admin/Renderable/InquiryDetail.php
app/Admin/Service/InquiryService.php
app/Admin/Service/UserService.php
resources/lang/en/inquiry.php
resources/lang/zh_CN/inquiry.php
resources/lang/zh_CN/validation.php
app/Admin/Controllers/InquiryController.php
View file @
3f7169f3
...
@@ -24,7 +24,7 @@ class InquiryController extends AdminController
...
@@ -24,7 +24,7 @@ class InquiryController extends AdminController
*/
*/
protected
function
grid
()
protected
function
grid
()
{
{
return
Grid
::
make
(
new
Inquiry
([
'user'
,
'sales_user'
]),
function
(
Grid
$grid
)
{
return
Grid
::
make
(
new
Inquiry
([
'user'
,
'sales_user'
]),
function
(
Grid
$grid
)
{
$grid
->
showFilter
();
$grid
->
showFilter
();
$grid
->
disableActions
();
$grid
->
disableActions
();
$grid
->
disableFilterButton
();
$grid
->
disableFilterButton
();
...
@@ -39,13 +39,14 @@ class InquiryController extends AdminController
...
@@ -39,13 +39,14 @@ class InquiryController extends AdminController
})
->
datetime
()
->
width
(
3
);
})
->
datetime
()
->
width
(
3
);
$filter
->
startWith
(
'user.company_name'
)
->
width
(
3
);
$filter
->
startWith
(
'user.company_name'
)
->
width
(
3
);
$filter
->
startWith
(
'user.id'
)
->
width
(
3
);
$filter
->
startWith
(
'user.id'
)
->
width
(
3
);
$filter
->
equal
(
'inquiry_id'
)
->
width
(
3
);
//
$filter->equal('inquiry_id')->width(3);
$filter
->
startWith
(
'user.email'
)
->
width
(
3
);
$filter
->
startWith
(
'user.email'
)
->
width
(
3
);
$filter
->
startWith
(
'user.phone'
)
->
width
(
3
);
$filter
->
startWith
(
'user.phone'
)
->
width
(
3
);
$filter
->
like
(
'inquiry_sn'
)
->
width
(
3
);
$filter
->
like
(
'inquiry_sn'
)
->
width
(
3
);
$filter
->
equal
(
'priority'
)
->
select
(
admin_trans
(
'inquiry.options.priority'
))
->
width
(
3
);
$filter
->
equal
(
'priority'
)
->
select
(
admin_trans
(
'inquiry.options.priority'
))
->
width
(
3
);
$filter
->
equal
(
'status'
)
->
select
(
admin_trans
(
'inquiry.options.status'
))
->
width
(
3
);
$filter
->
equal
(
'status'
)
->
select
(
admin_trans
(
'inquiry.options.status'
))
->
width
(
3
);
$filter
->
equal
(
'sales_id'
,
trans
(
'inquiry.fields.sales_name'
))
->
select
(
CmsUser
::
pluck
(
'name'
,
'userId'
)
->
toArray
())
->
width
(
3
);
$filter
->
equal
(
'sales_id'
,
trans
(
'inquiry.fields.sales_name'
))
->
select
(
CmsUser
::
pluck
(
'name'
,
'userId'
)
->
toArray
())
->
width
(
3
);
});
});
...
@@ -63,6 +64,9 @@ class InquiryController extends AdminController
...
@@ -63,6 +64,9 @@ class InquiryController extends AdminController
return
new
Card
(
$detail
)
.
new
Card
(
$list
);
return
new
Card
(
$detail
)
.
new
Card
(
$list
);
});
});
$grid
->
column
(
'task_type'
)
->
display
(
admin_trans
(
'inquiry.options.task_type.1'
));
$grid
->
column
(
'task_type'
)
->
display
(
admin_trans
(
'inquiry.options.task_type.1'
));
$grid
->
column
(
'user.user_sn'
)
->
display
(
function
(
$value
)
{
return
'<a target="_blank" iframe-extends=true iframe-tab=true href="/admin/users/'
.
$this
->
user
->
id
.
'" style="color:#1224cc">'
.
$value
.
'</a>'
;
});
$grid
->
column
(
'user.phone'
)
->
copyable
();
$grid
->
column
(
'user.phone'
)
->
copyable
();
$grid
->
column
(
'user.email'
)
->
copyable
();
$grid
->
column
(
'user.email'
)
->
copyable
();
$grid
->
column
(
'status'
)
->
using
(
admin_trans
(
'inquiry.options.status'
))
->
dot
([
$grid
->
column
(
'status'
)
->
using
(
admin_trans
(
'inquiry.options.status'
))
->
dot
([
...
@@ -85,9 +89,10 @@ class InquiryController extends AdminController
...
@@ -85,9 +89,10 @@ class InquiryController extends AdminController
$grid
->
column
(
'create_time'
)
->
display
(
function
(
$time
)
{
$grid
->
column
(
'create_time'
)
->
display
(
function
(
$time
)
{
return
date
(
'Y-m-d H:i:s'
,
$time
);
return
date
(
'Y-m-d H:i:s'
,
$time
);
})
->
sortable
();
})
->
sortable
();
$grid
->
column
(
'update_time'
)
->
display
(
function
(
$time
)
{
// $grid->column('update_time')->display(function ($time) {
return
$time
?
date
(
'Y-m-d H:i:s'
,
$time
)
:
''
;
// return $time ? date('Y-m-d H:i:s', $time) : '';
})
->
sortable
();
// })->sortable();
$grid
->
column
(
'source'
)
->
using
(
admin_trans
(
'inquiry.options.source'
));
});
});
}
}
...
...
app/Admin/Forms/HandleInquiry.php
View file @
3f7169f3
...
@@ -48,7 +48,8 @@ class HandleInquiry extends Form implements LazyRenderable
...
@@ -48,7 +48,8 @@ class HandleInquiry extends Form implements LazyRenderable
{
{
$this
->
hidden
(
'inquiry_id'
)
->
attribute
(
'id'
,
'inquiry_id'
);
$this
->
hidden
(
'inquiry_id'
)
->
attribute
(
'id'
,
'inquiry_id'
);
$this
->
radio
(
'status'
)
->
options
(
admin_trans
(
'inquiry.options.status'
))
->
default
(
0
)
->
required
();
$this
->
radio
(
'status'
)
->
options
(
admin_trans
(
'inquiry.options.status'
))
->
default
(
0
)
->
required
();
$this
->
textarea
(
'handle_result'
,
admin_trans
(
'global.labels.handle_result'
))
->
rows
(
5
)
->
required
();
$this
->
textarea
(
'handle_result'
,
admin_trans
(
'global.labels.handle_result'
))
->
rows
(
5
)
->
required
()
->
rules
(
'required|max:255'
);
}
}
/**
/**
...
...
app/Admin/Renderable/InquiryDetail.php
View file @
3f7169f3
...
@@ -37,7 +37,7 @@ class InquiryDetail extends LazyRenderable
...
@@ -37,7 +37,7 @@ class InquiryDetail extends LazyRenderable
$show
->
width
(
4
)
->
field
(
'priority'
)
->
using
(
admin_trans
(
'inquiry.options.priority'
));
$show
->
width
(
4
)
->
field
(
'priority'
)
->
using
(
admin_trans
(
'inquiry.options.priority'
));
});
});
$show
->
row
(
function
(
Show\Row
$show
)
{
$show
->
row
(
function
(
Show\Row
$show
)
{
$show
->
width
(
4
)
->
field
(
'user.
id
'
);
$show
->
width
(
4
)
->
field
(
'user.
user_sn
'
);
$show
->
width
(
4
)
->
field
(
'user.company_name'
);
$show
->
width
(
4
)
->
field
(
'user.company_name'
);
});
});
$show
->
row
(
function
(
Show\Row
$show
)
{
$show
->
row
(
function
(
Show\Row
$show
)
{
...
...
app/Admin/Service/InquiryService.php
View file @
3f7169f3
...
@@ -15,5 +15,4 @@ class InquiryService
...
@@ -15,5 +15,4 @@ class InquiryService
{
{
return
Inquiry
::
batchUpdateSalesId
(
$salesId
,
$userIds
);
return
Inquiry
::
batchUpdateSalesId
(
$salesId
,
$userIds
);
}
}
}
}
app/Admin/Service/UserService.php
View file @
3f7169f3
...
@@ -97,13 +97,13 @@ class UserService
...
@@ -97,13 +97,13 @@ class UserService
try
{
try
{
DB
::
beginTransaction
();
DB
::
beginTransaction
();
$userData
=
[
$userData
=
[
"company_name"
=>
$params
[
"company_name"
],
"company_name"
=>
$params
[
"company_name"
]
??
""
,
"user_sn"
=>
$params
[
"user_sn"
],
"user_sn"
=>
$params
[
"user_sn"
]
??
""
,
"first_name"
=>
$params
[
"first_name"
],
"first_name"
=>
$params
[
"first_name"
]
??
""
,
"last_name"
=>
$params
[
"last_name"
],
"last_name"
=>
$params
[
"last_name"
]
??
""
,
"phone"
=>
$params
[
"phone"
],
"phone"
=>
$params
[
"phone"
]
??
""
,
"email"
=>
$params
[
"email"
],
"email"
=>
$params
[
"email"
]
??
""
,
"name"
=>
$params
[
"email"
],
"name"
=>
$params
[
"email"
]
??
""
,
"reg_source"
=>
User
::
REG_SOURCE_MANUAL
,
"reg_source"
=>
User
::
REG_SOURCE_MANUAL
,
"remark"
=>
$params
[
"remark"
]
??
""
,
"remark"
=>
$params
[
"remark"
]
??
""
,
"password"
=>
""
,
"password"
=>
""
,
...
...
resources/lang/en/inquiry.php
View file @
3f7169f3
...
@@ -28,9 +28,9 @@ return [
...
@@ -28,9 +28,9 @@ return [
],
],
'options'
=>
[
'options'
=>
[
'status'
=>
[
'status'
=>
[
-
1
=>
'closed'
,
0
=>
'pending'
,
0
=>
'pending'
,
1
=>
'processed'
1
=>
'processed'
,
-
1
=>
'not_need_deal'
],
],
'priority'
=>
[
'priority'
=>
[
0
=>
'low'
,
0
=>
'low'
,
...
@@ -44,6 +44,10 @@ return [
...
@@ -44,6 +44,10 @@ return [
'task_type'
=>
[
'task_type'
=>
[
1
=>
'Inquiry'
,
1
=>
'Inquiry'
,
2
=>
'Bom'
2
=>
'Bom'
],
'source'
=>
[
1
=>
'Web'
,
2
=>
'Admin Web'
]
]
],
],
];
];
resources/lang/zh_CN/inquiry.php
View file @
3f7169f3
...
@@ -20,11 +20,12 @@ return [
...
@@ -20,11 +20,12 @@ return [
'create_time'
=>
'添加时间'
,
'create_time'
=>
'添加时间'
,
'update_time'
=>
'修改时间'
,
'update_time'
=>
'修改时间'
,
'task_type'
=>
'任务类型'
,
'task_type'
=>
'任务类型'
,
'user'
=>
[
'user'
=>
[
'id'
=>
'客户编码'
,
'id'
=>
'客户编码'
,
'email'
=>
'邮箱'
,
'email'
=>
'邮箱'
,
'phone'
=>
'电话'
,
'phone'
=>
'电话'
,
'company_name'
=>
'公司名称'
'company_name'
=>
'公司名称'
,
'user_sn'
=>
'用户编码'
,
],
],
'sales_user'
=>
[
'sales_user'
=>
[
'name'
=>
'业务员'
,
'name'
=>
'业务员'
,
...
@@ -32,9 +33,9 @@ return [
...
@@ -32,9 +33,9 @@ return [
],
],
'options'
=>
[
'options'
=>
[
'status'
=>
[
'status'
=>
[
-
1
=>
'已关闭'
,
0
=>
'待处理'
,
0
=>
'待处理'
,
1
=>
'已处理'
1
=>
'已处理'
,
-
1
=>
'无需处理'
,
],
],
'priority'
=>
[
'priority'
=>
[
0
=>
'低'
,
0
=>
'低'
,
...
@@ -48,6 +49,10 @@ return [
...
@@ -48,6 +49,10 @@ return [
'task_type'
=>
[
'task_type'
=>
[
1
=>
'询价'
,
1
=>
'询价'
,
2
=>
'bom'
2
=>
'bom'
],
'source'
=>
[
1
=>
'网站前台'
,
2
=>
'后台'
]
]
],
],
];
];
resources/lang/zh_CN/validation.php
0 → 100644
View file @
3f7169f3
<?php
/*
|--------------------------------------------------------------------------
| Validation Language Lines
|--------------------------------------------------------------------------
|
| The following language lines contain the default error messages used by
| the validator class. Some of these rules have multiple versions such
| as the size rules. Feel free to tweak each of these messages here.
|
*/
return
[
'accepted'
=>
'您必须接受 :attribute。'
,
'accepted_if'
=>
'当 :other 为 :value 时,必须接受 :attribute。'
,
'active_url'
=>
':attribute 不是一个有效的网址。'
,
'after'
=>
':attribute 必须要晚于 :date。'
,
'after_or_equal'
=>
':attribute 必须要等于 :date 或更晚。'
,
'alpha'
=>
':attribute 只能由字母组成。'
,
'alpha_dash'
=>
':attribute 只能由字母、数字、短划线(-)和下划线(_)组成。'
,
'alpha_num'
=>
':attribute 只能由字母和数字组成。'
,
'array'
=>
':attribute 必须是一个数组。'
,
'attached'
=>
'这个 :attribute 已经连接。'
,
'before'
=>
':attribute 必须要早于 :date。'
,
'before_or_equal'
=>
':attribute 必须要等于 :date 或更早。'
,
'between'
=>
[
'array'
=>
':attribute 必须只有 :min - :max 个单元。'
,
'file'
=>
':attribute 必须介于 :min - :max KB 之间。'
,
'numeric'
=>
':attribute 必须介于 :min - :max 之间。'
,
'string'
=>
':attribute 必须介于 :min - :max 个字符之间。'
,
],
'boolean'
=>
':attribute 必须为布尔值。'
,
'confirmed'
=>
':attribute 两次输入不一致。'
,
'current_password'
=>
'密码错误。'
,
'date'
=>
':attribute 不是一个有效的日期。'
,
'date_equals'
=>
':attribute 必须要等于 :date。'
,
'date_format'
=>
':attribute 的格式必须为 :format。'
,
'different'
=>
':attribute 和 :other 必须不同。'
,
'digits'
=>
':attribute 必须是 :digits 位数字。'
,
'digits_between'
=>
':attribute 必须是介于 :min 和 :max 位的数字。'
,
'dimensions'
=>
':attribute 图片尺寸不正确。'
,
'distinct'
=>
':attribute 已经存在。'
,
'email'
=>
':attribute 不是一个合法的邮箱。'
,
'ends_with'
=>
':attribute 必须以 :values 为结尾。'
,
'exists'
=>
':attribute 不存在。'
,
'file'
=>
':attribute 必须是文件。'
,
'filled'
=>
':attribute 不能为空。'
,
'gt'
=>
[
'array'
=>
':attribute 必须多于 :value 个元素。'
,
'file'
=>
':attribute 必须大于 :value KB。'
,
'numeric'
=>
':attribute 必须大于 :value。'
,
'string'
=>
':attribute 必须多于 :value 个字符。'
,
],
'gte'
=>
[
'array'
=>
':attribute 必须多于或等于 :value 个元素。'
,
'file'
=>
':attribute 必须大于或等于 :value KB。'
,
'numeric'
=>
':attribute 必须大于或等于 :value。'
,
'string'
=>
':attribute 必须多于或等于 :value 个字符。'
,
],
'image'
=>
':attribute 必须是图片。'
,
'in'
=>
'已选的属性 :attribute 无效。'
,
'in_array'
=>
':attribute 必须在 :other 中。'
,
'integer'
=>
':attribute 必须是整数。'
,
'ip'
=>
':attribute 必须是有效的 IP 地址。'
,
'ipv4'
=>
':attribute 必须是有效的 IPv4 地址。'
,
'ipv6'
=>
':attribute 必须是有效的 IPv6 地址。'
,
'json'
=>
':attribute 必须是正确的 JSON 格式。'
,
'lt'
=>
[
'array'
=>
':attribute 必须少于 :value 个元素。'
,
'file'
=>
':attribute 必须小于 :value KB。'
,
'numeric'
=>
':attribute 必须小于 :value。'
,
'string'
=>
':attribute 必须少于 :value 个字符。'
,
],
'lte'
=>
[
'array'
=>
':attribute 必须少于或等于 :value 个元素。'
,
'file'
=>
':attribute 必须小于或等于 :value KB。'
,
'numeric'
=>
':attribute 必须小于或等于 :value。'
,
'string'
=>
':attribute 必须少于或等于 :value 个字符。'
,
],
'max'
=>
[
'array'
=>
':attribute 最多只有 :max 个单元。'
,
'file'
=>
':attribute 不能大于 :max KB。'
,
'numeric'
=>
':attribute 不能大于 :max。'
,
'string'
=>
':attribute 不能大于 :max 个字符。'
,
],
'mimes'
=>
':attribute 必须是一个 :values 类型的文件。'
,
'mimetypes'
=>
':attribute 必须是一个 :values 类型的文件。'
,
'min'
=>
[
'array'
=>
':attribute 至少有 :min 个单元。'
,
'file'
=>
':attribute 大小不能小于 :min KB。'
,
'numeric'
=>
':attribute 必须大于等于 :min。'
,
'string'
=>
':attribute 至少为 :min 个字符。'
,
],
'multiple_of'
=>
':attribute 必须是 :value 中的多个值。'
,
'not_in'
=>
'已选的属性 :attribute 非法。'
,
'not_regex'
=>
':attribute 的格式错误。'
,
'numeric'
=>
':attribute 必须是一个数字。'
,
'password'
=>
'密码错误'
,
'present'
=>
':attribute 必须存在。'
,
'prohibited'
=>
':attribute 字段被禁止。'
,
'prohibited_if'
=>
'当 :other 为 :value 时,禁止 :attribute 字段。'
,
'prohibited_unless'
=>
':attribute 字段被禁止,除非 :other 位于 :values 中。'
,
'prohibits'
=>
':attribute 字段禁止出现 :other。'
,
'regex'
=>
':attribute 格式不正确。'
,
'relatable'
=>
'此 :attribute 可能与此资源不相关联。'
,
'required'
=>
':attribute 不能为空。'
,
'required_if'
=>
'当 :other 为 :value 时 :attribute 不能为空。'
,
'required_unless'
=>
'当 :other 不为 :values 时 :attribute 不能为空。'
,
'required_with'
=>
'当 :values 存在时 :attribute 不能为空。'
,
'required_with_all'
=>
'当 :values 存在时 :attribute 不能为空。'
,
'required_without'
=>
'当 :values 不存在时 :attribute 不能为空。'
,
'required_without_all'
=>
'当 :values 都不存在时 :attribute 不能为空。'
,
'same'
=>
':attribute 和 :other 必须相同。'
,
'size'
=>
[
'array'
=>
':attribute 必须为 :size 个单元。'
,
'file'
=>
':attribute 大小必须为 :size KB。'
,
'numeric'
=>
':attribute 大小必须为 :size。'
,
'string'
=>
':attribute 必须是 :size 个字符。'
,
],
'starts_with'
=>
':attribute 必须以 :values 为开头。'
,
'string'
=>
':attribute 必须是一个字符串。'
,
'timezone'
=>
':attribute 必须是一个合法的时区值。'
,
'unique'
=>
':attribute 已经存在。'
,
'uploaded'
=>
':attribute 上传失败。'
,
'url'
=>
':attribute 格式不正确。'
,
'uuid'
=>
':attribute 必须是有效的 UUID。'
,
'custom'
=>
[
'attribute-name'
=>
[
'rule-name'
=>
'custom-message'
,
],
],
'attributes'
=>
[
'email'
=>
'邮箱'
,
'attr_name'
=>
'参数名称'
,
'class_name'
=>
'分类名称'
,
'class_id'
=>
'分类'
,
'attr_unit_name'
=>
'单位名称'
,
],
];
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