Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
朱继来
/
后台订单管理
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
1c848c9b
authored
May 08, 2018
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
延长待付款时间
parent
def0c650
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
136 additions
and
10 deletions
app/Http/Controllers/OrderController.php
app/Http/routes.php
public/css/order.css
public/js/order.js
resources/views/detail/changeOrder.blade.php
app/Http/Controllers/OrderController.php
View file @
1c848c9b
...
...
@@ -1335,4 +1335,27 @@ Class OrderController extends Controller
}
}
// 延长付款时间
public
function
ajaxDelayTime
(
Request
$request
)
{
if
(
$request
->
isMethod
(
'post'
))
{
$order_id
=
$request
->
input
(
'order_id'
,
''
);
$delay_time
=
$request
->
input
(
'delay_time'
,
''
);
}
if
(
empty
(
$order_id
)
||
empty
(
$delay_time
))
return
[
'errcode'
=>
10003
,
'errmsg'
=>
'参数不存在'
];
$order
=
DB
::
connection
(
'order'
)
->
table
(
'lie_order'
)
->
where
(
'order_id'
,
'='
,
$order_id
)
->
select
(
'pay_time'
)
->
first
();
$delay_time
=
$order
->
pay_time
+
$delay_time
*
86400
;
$update
=
DB
::
connection
(
'order'
)
->
table
(
'lie_order'
)
->
where
(
'order_id'
,
'='
,
$order_id
)
->
update
([
'pay_time'
=>
$delay_time
]);
if
(
!
$update
)
{
return
[
'errcode'
=>
0
,
'errmsg'
=>
'延长失败'
];
}
return
[
'errcode'
=>
0
,
'errmsg'
=>
'延长成功'
];
}
}
\ No newline at end of file
app/Http/routes.php
View file @
1c848c9b
...
...
@@ -59,6 +59,8 @@ Route::group(['middleware' => 'web'], function () {
Route
::
get
(
'/count'
,
'OrderCountController@count'
);
Route
::
get
(
'/amount'
,
'OrderCountController@amount'
);
Route
::
match
(
'post'
,
'/ajaxDelayTime'
,
'OrderController@ajaxDelayTime'
);
});
// 不需要登陆态
...
...
public/css/order.css
View file @
1c848c9b
...
...
@@ -268,7 +268,7 @@ input[type="color"],
margin-bottom
:
0
;
}
#
payTime
{
.
payTime
{
float
:
left
;
margin-right
:
20px
;
}
...
...
@@ -289,9 +289,19 @@ input[type="color"],
.checked_right
{
position
:
absolute
;
right
:
0
;
line-height
:
6
0px
;
line-height
:
1
0px
;
}
.count_time
{
color
:
red
;
font-size
:
20px
;
}
.delay_time_title
{
float
:
left
;
}
.showtime
{
height
:
30px
;
line-height
:
30px
;
}
.delay_confirm
{
margin-bottom
:
5px
;
}
\ No newline at end of file
public/js/order.js
View file @
1c848c9b
...
...
@@ -1137,10 +1137,10 @@
})
// 选择付款时间
$
(
'
#
payTime'
).
change
(
function
(){
$
(
'
.
payTime'
).
change
(
function
(){
var
val
=
$
(
this
).
val
();
if
(
val
==
0
)
{
if
(
val
==
'other'
)
{
$
(
'.customArea'
).
show
();
}
else
{
$
(
'.customArea'
).
hide
();
...
...
@@ -1152,8 +1152,8 @@
var
sale_id
=
$
(
'input[name=sale_id]:checked'
).
val
();
var
order_status
=
$
(
'input[name=order_status]:checked'
).
val
();
var
reason
=
$
(
'input[name=reason]:checked'
).
val
();
var
payTime
=
$
(
'
#
payTime'
).
val
();
var
payTimeOther
=
$
(
'
#
payTimeOther'
).
val
();
var
payTime
=
$
(
'
.
payTime'
).
val
();
var
payTimeOther
=
$
(
'
.
payTimeOther'
).
val
();
if
(
sale_id
==
null
)
{
layer
.
msg
(
'请选择业务员!'
);
...
...
@@ -1211,7 +1211,7 @@
return
false
;
}
if
(
payTime
==
0
&&
payTimeOther
==
''
)
{
if
(
payTime
==
'other'
&&
payTimeOther
==
''
)
{
layer
.
msg
(
'请填写自定义时间'
);
return
false
;
}
...
...
resources/views/detail/changeOrder.blade.php
View file @
1c848c9b
...
...
@@ -154,7 +154,7 @@
<tr>
<th>
选择付款时间
</th>
<td>
<select
name=
"payTime"
id
=
"payTime"
>
<select
name=
"payTime"
class
=
"payTime"
>
<option
value=
""
>
请选择
</option>
<option
value=
"1"
>
1天
</option>
<option
value=
"3"
>
3天
</option>
...
...
@@ -164,7 +164,7 @@
</select>
<div
class=
"customArea"
>
<input
type=
"text"
name=
"payTimeOther"
id
=
"payTimeOther"
value=
""
style=
"width: 50px;"
>
天
<span
class=
"error"
>
(自定义天数,限制1~30)
</span>
<input
type=
"text"
name=
"payTimeOther"
class
=
"payTimeOther"
value=
""
style=
"width: 50px;"
>
天
<span
class=
"error"
>
(自定义天数,限制1~30)
</span>
</div>
</td>
</tr>
...
...
@@ -189,13 +189,32 @@
</div>
<div
class=
"checked_right"
>
<p>
<p
class=
"showtime"
>
<span
class=
"error"
>
剩余付款时间:
</span>
<span
class=
"count_time count_day"
></span>
天
<span
class=
"count_time count_hour"
></span>
时
<span
class=
"count_time count_min"
></span>
分
<span
class=
"count_time count_sec"
></span>
秒
</p>
<div
class=
"showtime delay_time"
>
<span
class=
"delay_time_title"
>
延长付款时间:
</span>
<select
name=
"payTime"
class=
"payTime"
>
<option
value=
""
>
请选择
</option>
<option
value=
"1"
>
1天
</option>
<option
value=
"3"
>
3天
</option>
<option
value=
"7"
>
7天
</option>
<option
value=
"15"
>
15天
</option>
<option
value=
"other"
>
其他
</option>
</select>
<div
class=
"customArea"
>
<input
type=
"text"
name=
"payTimeOther"
class=
"payTimeOther"
value=
""
style=
"width: 50px;"
>
天
<span
class=
"error"
>
(自定义天数,限制1~30)
</span>
</div>
<button
class=
"btn btn-info btn-xs delay_confirm"
>
确认
</button>
</div>
</div>
</div>
@endif
...
...
@@ -257,4 +276,73 @@
clearInterval
(
timer
);
}
}
// 延长付款时间
$
(
'.delay_confirm'
).
click
(
function
(){
var
order_id
=
"{{$order_info['order_id']}}"
;
var
payTime
=
$
(
'.payTime'
).
val
();
var
payTimeOther
=
$
(
'.payTimeOther'
).
val
();
var
delay_time
;
if
(
payTime
==
''
)
{
layer
.
msg
(
'请选择付款时间'
);
return
false
;
}
if
(
payTime
==
'other'
&&
payTimeOther
==
''
)
{
layer
.
msg
(
'请填写自定义时间'
);
return
false
;
}
if
(
payTimeOther
)
{
var
reg
=
/
\d
/
;
if
(
!
reg
.
test
(
payTimeOther
))
{
layer
.
msg
(
'格式错误'
);
return
false
;
}
if
(
payTimeOther
<
0
||
payTimeOther
>
30
)
{
layer
.
msg
(
'自定义时间限制在1-30天'
);
return
false
;
}
}
if
(
payTime
!=
''
&&
payTime
!=
'other'
)
{
payTimeOther
=
''
;
}
delay_time
=
payTimeOther
?
payTimeOther
:
payTime
;
// 弹出提示
layer
.
open
({
title
:
'提示信息'
,
content
:
'确定延长付款时间吗?'
,
btn
:[
'取消'
,
'确定'
],
yes
:
function
(
index
,
layero
){
layer
.
close
(
index
);
},
btn2
:
function
(
index
,
layero
){
$
.
ajax
({
url
:
'/ajaxDelayTime'
,
type
:
'post'
,
data
:
{
order_id
:
order_id
,
delay_time
:
delay_time
},
dataType
:
'json'
,
success
:
function
(
resp
)
{
console
.
log
(
resp
)
if
(
resp
.
errcode
===
0
){
layer
.
msg
(
resp
.
errmsg
||
'操作成功'
);
setTimeout
(
function
(){
location
.
reload
();
},
1000
);
}
else
{
layer
.
alert
(
resp
.
errmsg
||
'网络异常'
);
}
},
error
:
function
(
res
)
{
console
.
log
(
res
);
}
})
}
});
})
</script>
\ No newline at end of file
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