Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
backend
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
亲子游项目
backend
Commits
7788147e
Commit
7788147e
authored
Nov 05, 2018
by
LiuJunYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除活动
parent
883782ab
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
30 additions
and
17 deletions
+30
-17
application/admin/controller/Guide.php
+1
-0
application/admin/controller/Order.php
+10
-4
application/admin/controller/Project.php
+8
-4
application/admin/view/guide/update.html
+2
-1
application/admin/view/order/index.html
+4
-4
application/admin/view/project/appoint.html
+4
-4
application/common/model/Orders.php
+1
-0
No files found.
application/admin/controller/Guide.php
View file @
7788147e
...
...
@@ -117,6 +117,7 @@ class Guide extends AuthBase
if
(
!
$validate
->
scene
(
'update'
)
->
check
(
$data
))
{
$msg
=
$validate
->
getError
();
$this
->
assign
(
'msg'
,
$msg
);
// halt($msg);
return
view
();
}
$condition
=
[
...
...
application/admin/controller/Order.php
View file @
7788147e
...
...
@@ -53,7 +53,13 @@ class Order extends AuthBase
}
}
//根据筛选条件查询
$order_list
=
$this
->
order_model
->
where
(
$condition
)
->
order
(
'created_at desc'
)
->
paginate
(
10
,
false
,
[
'query'
=>
[
'status'
=>
$status
,
'start_time'
=>
$start_time
,
'end_time'
=>
$end_time
,
'type'
=>
$type
]]);
$order_list
=
$this
->
order_model
->
with
([
'project'
=>
function
(
$query
)
{
}])
->
where
(
$condition
)
->
order
(
'created_at desc'
)
->
paginate
(
10
,
false
,
[
'query'
=>
[
'status'
=>
$status
,
'start_time'
=>
$start_time
,
'end_time'
=>
$end_time
,
'type'
=>
$type
]])
->
each
(
function
(
$item
)
{
$project
=
\app\common\model\Project
::
withTrashed
()
->
find
(
$item
[
'pid'
]);
$item
[
'project_poster'
]
=
$project
[
'poster'
];
$item
[
'project_title'
]
=
$project
[
'title'
];
});
$this
->
assign
(
"order_list"
,
$order_list
);
$this
->
assign
(
"status"
,
$status
);
return
$this
->
fetch
();
...
...
@@ -236,13 +242,13 @@ class Order extends AuthBase
}
$order
=
\app\common\model\Order
::
get
(
$refund
->
order_id
);
Db
::
startTrans
();
try
{
try
{
//修改订单状态
$refund
->
status
=
2
;
$order
->
is_refund
=
3
;
$order
->
status
=
3
;
$project
=
\app\common\model\Project
::
get
(
$order
->
pid
);
$project
->
sign_num
=
$project
->
sign_num
-
$order
[
'extras'
][
'sign_limits'
];
$project
->
sign_num
=
$project
->
sign_num
-
$order
[
'extras'
][
'sign_limits'
];
$refund
->
save
();
//修改退款列表状态
$order
->
save
();
//修改订单状态
$project
->
save
();
//减少限制数组量
...
...
@@ -277,7 +283,7 @@ class Order extends AuthBase
}
else
{
throw
new
Exception
(
$result
[
'return_msg'
]);
}
}
catch
(
Exception
$e
)
{
}
catch
(
Exception
$e
)
{
Db
::
rollback
();
return
json
([
'code'
=>
1
,
'msg'
=>
$e
->
getMessage
()]);
}
...
...
application/admin/controller/Project.php
View file @
7788147e
...
...
@@ -125,9 +125,9 @@ class Project extends AuthBase
{
$id
=
input
(
'post.id'
);
$used
=
model
(
'Orders'
)
->
where
(
'pid'
,
$id
)
->
count
();
if
(
$used
>
0
)
{
$this
->
error
(
'该项目已有用户下单,不可删除!'
,
''
,
''
,
1
);
}
//
if ($used > 0) {
//
$this->error('该项目已有用户下单,不可删除!', '', '', 1);
//
}
$res
=
model
(
'project'
)
->
destroy
(
$id
);
if
(
$res
)
{
...
...
@@ -301,7 +301,11 @@ class Project extends AuthBase
public
function
appoint
()
{
$title
=
input
(
'get.name'
,
''
);
$items
=
$this
->
appoint_model
->
where
(
'nickname'
,
'like'
,
"%"
.
$title
.
"%"
)
->
order
(
'id'
,
'desc'
)
->
paginate
(
15
,
false
,
[
'query'
=>
[
'nickname'
=>
$title
]]);
$items
=
$this
->
appoint_model
->
where
(
'nickname'
,
'like'
,
"%"
.
$title
.
"%"
)
->
order
(
'id'
,
'desc'
)
->
paginate
(
15
,
false
,
[
'query'
=>
[
'nickname'
=>
$title
]])
->
each
(
function
(
$item
){
$project
=
\app\common\model\Project
::
withTrashed
()
->
find
(
$item
[
'pid'
]);
$item
[
'project_poster'
]
=
$project
[
'poster'
];
$item
[
'project_title'
]
=
$project
[
'title'
];
});
$this
->
assign
(
"items"
,
$items
);
return
$this
->
fetch
(
''
);
}
...
...
application/admin/view/guide/update.html
View file @
7788147e
...
...
@@ -14,7 +14,7 @@
<h3
class=
""
>
<a
href=
"<?php echo url('@admin/Guide/index')?>"
>
<i
class=
"fa fa-angle-right"
></i>
<a
href=
"{:url('admin/Guide/index')}"
>
美行攻略
</a>
<i
class=
"fa fa-angle-right"
></i>
{if
condition="$article"
}
{if
$article
}
修改攻略
{else/}
发布攻略
...
...
@@ -107,6 +107,7 @@
</div>
<div
class=
"form-group"
>
<div
class=
"col-sm-offset-2 col-sm-10"
>
<input
type=
"hidden"
name=
"id"
value=
"{$article.id??'';}"
>
<button
type=
"submit"
class=
"btn btn-success"
id=
"btn-save"
>
提交
</button>
</div>
</div>
...
...
application/admin/view/order/index.html
View file @
7788147e
...
...
@@ -68,11 +68,11 @@
{/if}
</td>
<td>
{if condition="$vo.project"}
<a
href=
"{$vo.project
.
poster}"
target=
"_blank"
data-fancybox=
"images"
>
<img
src=
"{$vo.project
.
poster}"
width=
'100'
>
{if condition="$vo.project
_poster
"}
<a
href=
"{$vo.project
_
poster}"
target=
"_blank"
data-fancybox=
"images"
>
<img
src=
"{$vo.project
_
poster}"
width=
'100'
>
</a>
<p
style=
"padding:0;margin:0;"
>
{$vo.project
.
title}
</p>
<p
style=
"padding:0;margin:0;"
>
{$vo.project
_
title}
</p>
{/if}
</td>
<td>
...
...
application/admin/view/project/appoint.html
View file @
7788147e
...
...
@@ -37,11 +37,11 @@
<tr
id=
"tr_{$vo.id}"
>
<td>
{$k}
</td>
<td>
{if condition="$vo.project"}
<a
href=
"{$vo.project
.
poster}"
target=
"_blank"
data-fancybox=
"images"
>
<img
src=
"{$vo.project
.
poster}"
width=
'100'
>
{if condition="$vo.project
_poster
"}
<a
href=
"{$vo.project
_
poster}"
target=
"_blank"
data-fancybox=
"images"
>
<img
src=
"{$vo.project
_
poster}"
width=
'100'
>
</a>
<p
style=
"padding:0;margin:0;"
>
{$vo.project
.
title}
</p>
<p
style=
"padding:0;margin:0;"
>
{$vo.project
_
title}
</p>
{/if}
</td>
<td>
...
...
application/common/model/Orders.php
View file @
7788147e
...
...
@@ -21,4 +21,5 @@ class Orders extends BaseModel
public
function
getProjectNameAttr
(
$value
,
$data
){
return
ProjectModel
::
get
(
$data
[
'pid'
]);
}
}
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