切换导航条
此项目
正在载入...
登录
root
/
chengxiang
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
王晓刚
6 years ago
提交
42c6a796cf296cf3b24dc9e1a51218cf5425835b
1 个父辈
9df0afdb
1 个管道 的构建
通过
耗费 1 秒
代理人注册
变更
3
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
380 行增加
和
0 行删除
app/admin/controller/OrderController.php
public/themes/admin_simpleboot3/admin/order/edit.html
public/themes/admin_simpleboot3/admin/order/index.html
app/admin/controller/OrderController.php
0 → 100644
查看文件 @
42c6a79
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/1/5
* Time: 15:21
*/
namespace
app\admin\controller
;
use
cmf\controller\AdminBaseController
;
use
think\Db
;
use
think\Validate
;
class
OrderController
extends
AdminBaseController
{
public
function
index
(){
$where
=
[];
$param
=
$this
->
request
->
param
();
$startTime
=
empty
(
$param
[
'start_time'
])
?
0
:
strtotime
(
$param
[
'start_time'
]);
$endTime
=
empty
(
$param
[
'end_time'
])
?
0
:
strtotime
(
$param
[
'end_time'
]);
if
(
!
empty
(
$startTime
)
&&
!
empty
(
$endTime
))
{
$where
[
'a_a.create_time'
]
=
[[
'>= time'
,
$startTime
],
[
'<= time'
,
$endTime
]];
}
else
{
if
(
!
empty
(
$startTime
))
{
$where
[
'a_a.create_time'
]
=
[
'>= time'
,
$startTime
];
}
if
(
!
empty
(
$endTime
))
{
$where
[
'a_a.create_time'
]
=
[
'<= time'
,
$endTime
];
}
}
$keyword
=
empty
(
$param
[
'keyword'
])
?
''
:
$param
[
'keyword'
];
if
(
!
empty
(
$keyword
))
{
$where
[
'u.nickname'
]
=
[
'like'
,
"%
$keyword
%"
];
}
$status
=
empty
(
$param
[
'status'
])
?
''
:
$param
[
'status'
];
if
(
!
empty
(
$status
))
{
$where
[
'a_a.status'
]
=
[
'eq'
,
"%
$status
%"
];
}
$field
=
"c.*,i_c.thumbnail,i_c.insurance_company_name,o.order_expire_time,o.order_about_time,o.status,o.id o_id"
;
$data
=
Db
::
name
(
'order_info'
)
->
alias
(
'o_i'
)
->
field
(
$field
)
->
join
(
'cmf_order o'
,
'o.id = o_i.order_id'
)
->
join
(
'cmf_collocation c'
,
'c.id = o_i.collocation_id'
)
->
join
(
'cmf_insurance_company i_c'
,
'c.insurance_company_id = i_c.id'
)
->
where
(
'c_delete_time'
,
0
)
->
where
(
$where
)
->
order
(
'a_a.create_time desc'
)
->
paginate
(
10
);
$data
->
appends
(
$param
);
$list
=
$data
->
items
();
dump
(
$list
);
exit
();
$this
->
assign
([
'data'
=>
$list
,
'page'
=>
$data
->
render
(),
'start_time'
=>
isset
(
$param
[
'start_time'
])
?
$param
[
'start_time'
]
:
''
,
'end_time'
=>
isset
(
$param
[
'end_time'
])
?
$param
[
'end_time'
]
:
''
,
'keyword'
=>
isset
(
$param
[
'keyword'
])
?
$param
[
'keyword'
]
:
''
,
]);
return
$this
->
fetch
();
}
//编辑
public
function
edit
(){
$id
=
$this
->
request
->
param
(
'id'
,
0
,
'intval'
);
if
(
$this
->
request
->
isPost
()){
$param
=
$this
->
request
->
param
();
$validate
=
new
Validate
([
'status'
=>
'require'
,
]);
$validate
->
message
([
'status'
=>
'请选择审核状态!'
,
]);
if
(
!
$validate
->
check
(
$param
))
{
$this
->
error
(
$validate
->
getError
());
}
Db
::
name
(
'application_agent'
)
->
where
(
'id'
,
$id
)
->
update
(
$param
);
$agent
=
Db
::
name
(
'application_agent'
)
->
where
(
'id'
,
$id
)
->
find
();
if
(
$param
[
'status'
]
==
2
){
Db
::
name
(
'user'
)
->
where
(
'id'
,
$agent
[
'user_id'
])
->
update
(
array
(
'type'
=>
2
,
'agent_name'
=>
$agent
[
'name'
],
'mobile2'
=>
$agent
[
'phone'
]));
}
else
{
Db
::
name
(
'user'
)
->
where
(
'id'
,
$agent
[
'user_id'
])
->
update
(
array
(
'type'
=>
1
,
'agent_name'
=>
null
,
'mobile2'
=>
null
));
}
$this
->
success
(
'更新成功!'
);
}
else
{
$data
=
Db
::
name
(
'application_agent'
)
->
alias
(
'a_a'
)
->
field
(
'a_a.*,u.user_nickname'
)
->
join
(
'cmf_user u'
,
'u.id = a_a.user_id'
)
->
where
(
'a_a.id'
,
$id
)
->
find
();
$this
->
assign
([
'data'
=>
$data
,
]);
return
$this
->
fetch
();
}
}
//删除
public
function
delete
(){
$param
=
$this
->
request
->
param
();
if
(
isset
(
$param
[
'id'
]))
{
$id
=
$this
->
request
->
param
(
'id'
,
0
,
'intval'
);
$resultPortal
=
Db
::
name
(
'application_agent'
)
->
where
([
'id'
=>
$id
])
->
update
([
'delete_time'
=>
time
()]);
if
(
$resultPortal
){
$this
->
success
(
"删除成功!"
,
''
);
}
else
{
$this
->
error
(
"删除失败!"
,
''
);
}
}
if
(
isset
(
$param
[
'ids'
]))
{
$ids
=
$this
->
request
->
param
(
'ids/a'
);
$result
=
Db
::
name
(
'application_agent'
)
->
where
([
'id'
=>
[
'in'
,
$ids
]])
->
update
([
'delete_time'
=>
time
()]);
if
(
$result
)
{
$this
->
success
(
"删除成功!"
,
''
);
}
else
{
$this
->
error
(
"删除失败!"
,
''
);
}
}
}
//审核
public
function
publish
(){
$param
=
$this
->
request
->
param
();
$ids
=
$this
->
request
->
param
(
'ids/a'
);
if
(
!
empty
(
$ids
)
&&!
empty
(
$param
[
'yes'
])){
Db
::
name
(
'application_agent'
)
->
where
([
'id'
=>
[
'in'
,
$ids
]])
->
update
(
array
(
'status'
=>
2
));
foreach
(
$ids
as
$key
=>
$i1
){
$data
=
Db
::
name
(
'application_agent'
)
->
where
(
'id'
,
$i1
)
->
find
();
Db
::
name
(
'user'
)
->
where
(
'id'
,
$data
[
'user_id'
])
->
update
(
array
(
'mobile2'
=>
$data
[
'phone'
],
'type'
=>
2
,
'agent_name'
=>
$data
[
'name'
]));
}
$this
->
success
(
'操作成功!'
,
''
);
}
else
{
Db
::
name
(
'application_agent'
)
->
where
([
'id'
=>
[
'in'
,
$ids
]])
->
update
(
array
(
'status'
=>
3
));
foreach
(
$ids
as
$key
=>
$i2
){
$data
=
Db
::
name
(
'application_agent'
)
->
where
(
'id'
,
$i2
)
->
find
();
Db
::
name
(
'user'
)
->
where
(
'id'
,
$data
[
'user_id'
])
->
update
(
array
(
'mobile2'
=>
null
,
'type'
=>
1
,
'agent_name'
=>
null
));
}
$this
->
success
(
'操作成功!'
,
''
);
}
}
}
\ No newline at end of file
...
...
public/themes/admin_simpleboot3/admin/order/edit.html
0 → 100644
查看文件 @
42c6a79
<include
file=
"public@header"
/>
</head>
<body>
<div
class=
"wrap js-check-wrap"
>
<ul
class=
"nav nav-tabs"
>
<li><a
href=
"{:url('Order/index')}"
>
订单列表
</a></li>
<li
class=
"active"
><a
href=
"#"
>
订单详情
</a></li>
</ul>
<form
action=
"{:url('Order/edit')}"
method=
"post"
class=
"form-horizontal js-ajax-form margin-top-20"
>
<div
class=
"row"
>
<div
class=
"col-md-9"
>
<table
class=
"table table-bordered"
>
<tr>
<th
width=
"100"
>
用户昵称
</th>
<td>
<input
class=
"form-control"
type=
"text"
name=
""
id=
"user_nickname"
value=
"{$data.user_nickname}"
placeholder=
"请输入用户昵称"
/>
<input
type=
"hidden"
name=
"id"
value=
"{$data.id}"
>
</td>
</tr>
<tr>
<th
width=
"100"
>
姓名
</th>
<td>
<input
class=
"form-control"
type=
"text"
name=
""
id=
"title"
value=
"{$data.name}"
placeholder=
"请输入姓名"
/>
</td>
</tr>
<tr>
<th
width=
"100"
>
手机号
</th>
<td>
<input
class=
"form-control"
type=
"text"
name=
""
id=
"phone"
value=
"{$data.phone}"
placeholder=
"请输入手机号"
/>
</td>
</tr>
<tr>
<th
width=
"100"
>
生日
</th>
<td>
<input
class=
"form-control"
type=
"text"
name=
""
id=
"date"
value=
"{$data.date}"
placeholder=
"请输入生日"
/>
</td>
</tr>
<tr>
<th
width=
"100"
>
身份证号
</th>
<td>
<input
class=
"form-control"
type=
"text"
name=
""
id=
"card_id"
value=
"{$data.card_id}"
placeholder=
"请输入身份证号"
/>
</td>
</tr>
<tr>
<th
width=
"100"
>
公司
</th>
<td>
<input
class=
"form-control"
type=
"text"
name=
""
id=
"company"
value=
"{$data.company}"
placeholder=
"请输入公司"
/>
</td>
</tr>
</table>
<div
class=
"form-group"
>
<div
class=
"col-sm-offset-2 col-sm-10"
>
<button
type=
"submit"
class=
"btn btn-primary js-ajax-submit"
>
{:lang('SAVE')}
</button>
<a
class=
"btn btn-default"
href=
"javascript:history.back(-1);"
>
{:lang('BACK')}
</a>
</div>
</div>
</div>
<div
class=
"col-md-3"
>
<table
class=
"table table-bordered"
>
<tr>
<th>
状态
</th>
</tr>
<tr>
<td>
<div
class=
"radio"
>
<label><input
type=
"radio"
name=
"status"
value=
"2"
<
eq
name=
"$data.status"
value=
"2"
>
checked
</eq>
>审核通过
</label>
</div>
</td>
</tr>
<tr>
<td>
<div
class=
"radio"
>
<label><input
type=
"radio"
name=
"status"
value=
"3"
<
eq
name=
"$data.status"
value=
"3"
>
checked
</eq>
>审核未通过
</label>
</div>
</td>
</tr>
</table>
</div>
</div>
</form>
</div>
<script
type=
"text/javascript"
src=
"__STATIC__/js/admin.js"
></script>
<script
type=
"text/javascript"
>
//编辑器路径定义
var
editorURL
=
GV
.
WEB_ROOT
;
</script>
<script
type=
"text/javascript"
src=
"__STATIC__/js/ueditor/ueditor.config.js"
></script>
<script
type=
"text/javascript"
src=
"__STATIC__/js/ueditor/ueditor.all.min.js"
></script>
<script
type=
"text/javascript"
>
$
(
function
()
{
editorcontent
=
new
baidu
.
editor
.
ui
.
Editor
();
editorcontent
.
render
(
'content'
);
try
{
editorcontent
.
sync
();
}
catch
(
err
)
{
}
$
(
'.btn-cancel-thumbnail'
).
click
(
function
()
{
$
(
'#thumbnail-preview'
).
attr
(
'src'
,
'__TMPL__/public/assets/images/default-thumbnail.png'
);
$
(
'#thumbnail'
).
val
(
''
);
});
$
(
'.btn-cancel-thumbnail1'
).
click
(
function
()
{
$
(
'#thumbnail-preview1'
).
attr
(
'src'
,
'__TMPL__/public/assets/images/default-thumbnail.png'
);
$
(
'#thumbnail1'
).
val
(
''
);
});
});
</script>
</body>
</html>
...
...
public/themes/admin_simpleboot3/admin/order/index.html
0 → 100644
查看文件 @
42c6a79
<include
file=
"public@header"
/>
</head>
<body>
<div
class=
"wrap js-check-wrap"
>
<ul
class=
"nav nav-tabs"
>
<li
class=
"active"
><a
href=
"{:url('Order/index')}"
>
订单列表
</a></li>
</ul>
<form
class=
"well form-inline margin-top-20"
method=
"post"
action=
"{:url('Order/index')}"
>
状态:
<select
class=
"form-control"
name=
"category"
>
<option
value=
"0"
>
全部
</option>
<option
value=
"1"
>
未托管
</option>
<option
value=
"2"
>
已托管
</option>
<option
value=
"3"
>
即将到期
</option>
</select>
关键字:
<input
type=
"text"
class=
"form-control"
name=
"keyword"
style=
"width: 150px;"
value=
"{$keyword|default=''}"
placeholder=
"请输入关键字..."
>
<input
type=
"submit"
class=
"btn btn-primary"
value=
"搜索"
/>
<a
class=
"btn btn-danger"
href=
"{:url('Order/index')}"
>
清空
</a>
</form>
<form
class=
"js-ajax-form"
action=
""
method=
"post"
>
<table
class=
"table table-hover table-bordered"
>
<div
class=
"table-actions"
>
<button
class=
"btn btn-danger btn-sm js-ajax-submit"
data-action=
"{:url('Order/delete')}"
data-subcheck=
"true"
data-msg=
"你确定删除吗?"
>
{:lang('DELETE')}
</button>
</div>
<thead>
<tr>
<th>
<label>
<input
type=
"checkbox"
class=
"js-check-all"
data-direction=
"x"
data-checklist=
"js-check-x"
>
</label>
</th>
<th>
ID
</th>
<th>
用户昵称
</th>
<th>
姓名
</th>
<th>
手机号
</th>
<th>
生日
</th>
<th>
身份证号
</th>
<th>
公司
</th>
<th>
申请时间
</th>
<th>
状态
</th>
<th>
操作
</th>
</tr>
</thead>
<tbody>
<foreach
name=
"data"
item=
"vo"
>
<tr>
<td>
<input
type=
"checkbox"
class=
"js-check"
data-yid=
"js-check-y"
data-xid=
"js-check-x"
name=
"ids[]"
value=
"{$vo.id}"
title=
"ID:{$vo.id}"
>
</td>
<td>
{$vo.id}
</td>
<td>
{$vo.user_nickname}
</td>
<td>
{$vo.name}
</td>
<td>
{$vo.phone}
</td>
<td>
{$vo.date}
</td>
<td>
{$vo.card_id}
</td>
<td>
{$vo.company}
</td>
<td>
{:date('Y-m-d H:i:s',$vo['create_time'])}
</td>
<td>
<if
condition=
"$vo.status eq 1"
>
未审核
<elseif
condition=
"$vo.status eq 2"
/>
通过审核
<elseif
condition=
"$vo.status eq 3"
/>
未通过审核
</if>
</td>
<td>
<a
href=
'{:url("ApplicationAgent/edit",array("id"=>$vo["id"]))}'
>
审核
</a>
|
<a
class=
"js-ajax-delete"
href=
"{:url('ApplicationAgent/delete',array('id'=>$vo['id']))}"
>
{:lang('DELETE')}
</a>
</td>
</tr>
</foreach>
</tbody>
<thead>
<tr>
<th>
<label>
<input
type=
"checkbox"
class=
"js-check-all"
data-direction=
"x"
data-checklist=
"js-check-x"
>
</label>
</th>
<th>
ID
</th>
<th>
用户昵称
</th>
<th>
姓名
</th>
<th>
手机号
</th>
<th>
生日
</th>
<th>
身份证号
</th>
<th>
公司
</th>
<th>
申请时间
</th>
<th>
状态
</th>
<th>
操作
</th>
</tr>
</thead>
</table>
<div
class=
"table-actions"
>
<button
class=
"btn btn-danger btn-sm js-ajax-submit"
data-action=
"{:url('ApplicationAgent/delete')}"
data-subcheck=
"true"
data-msg=
"你确定删除吗?"
>
{:lang('DELETE')}
</button>
</div>
<div
class=
"pagination"
>
{$page}
</div>
</form>
</div>
<script
src=
"__STATIC__/js/admin.js"
></script>
</body>
</html>
\ No newline at end of file
...
...
请
注册
或
登录
后发表评论