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
bb535407
authored
Apr 02, 2018
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1. 添加付款时间限制
2. 检查付款时间
parent
6ed37108
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
125 additions
and
0 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 @
bb535407
...
...
@@ -573,6 +573,8 @@ Class OrderController extends Controller
"order_amount"
=>
$request
->
input
(
'order_amount'
,
''
),
"extra_fee"
=>
$request
->
input
(
'extra_fee'
,
''
),
"change_info"
=>
$request
->
input
(
'change_info'
,
''
),
"payTime"
=>
$request
->
input
(
'payTime'
,
''
),
"payTimeOther"
=>
$request
->
input
(
'payTimeOther'
,
''
),
"order_id"
=>
$order_id
,
"pf"
=>
1
,
"k1"
=>
$check
[
'k1'
],
...
...
@@ -1029,5 +1031,66 @@ Class OrderController extends Controller
return
$response
;
}
// 测试帐号
public
function
testMobile
()
{
$testId
=
array
();
$user
=
DB
::
connection
(
'order'
)
->
table
(
'lie_user_main'
)
->
select
(
'user_id'
)
->
where
([
'is_test'
=>
1
])
->
get
();
foreach
(
$user
as
$k
=>
$v
)
{
$testId
[
$k
]
=
$v
->
user_id
;
}
return
$testId
;
}
// 检查订单付款时间 (状态)
public
function
checkOrderPay
()
{
$order
=
DB
::
connection
(
'order'
)
->
table
(
'lie_order'
)
->
whereIn
(
'status'
,
[
'2'
,
'3'
])
->
whereNotIn
(
'user_id'
,
$this
->
testMobile
())
->
where
(
'is_type'
,
'='
,
0
)
->
select
(
'order_id'
,
'order_sn'
,
'user_id'
,
'order_amount'
,
'currency'
,
'pay_time'
)
->
orderBy
(
'create_time'
,
'DESC'
)
->
get
();
//调用消息接口
$url
=
Config
(
'website.api_domain'
)
.
'msg/sendmessagebyauto'
;
$data
[
'k1'
]
=
time
();
$data
[
'k2'
]
=
md5
(
md5
(
$data
[
'k1'
])
.
'fh6y5t4rr351d2c3bryi'
);
$keyword
=
'order-pay-time-remind'
;
if
(
!
empty
(
$order
))
{
foreach
(
$order
as
$v
)
{
$diff
=
$v
->
pay_time
-
time
();
// 提前一天推送消息
if
(
$diff
<=
86400
)
{
$currency
=
$v
->
currency
==
1
?
'¥'
:
'$'
;
$orderData
=
[
"keyword"
=>
$keyword
,
"pf"
=>
1
,
"k1"
=>
$data
[
'k1'
],
"k2"
=>
$data
[
'k2'
],
'touser'
=>
json_encode
(
$v
->
user_id
),
'data'
=>
json_encode
([
$v
->
order_sn
,
$currency
.
$v
->
order_amount
]),
];
$temp
=
json_decode
(
curlApi
(
$url
,
$orderData
,
"POST"
),
true
);
if
(
$temp
[
'err_code'
]
==
0
)
{
continue
;
}
}
}
}
}
}
\ No newline at end of file
app/Http/routes.php
View file @
bb535407
...
...
@@ -60,3 +60,8 @@ Route::group(['middleware' => 'web'], function () {
});
// 不需要登陆态
Route
::
group
([
'middleware'
=>
'api'
],
function
()
{
Route
::
get
(
'/api/check/paytime'
,
'OrderController@checkOrderPay'
);
});
public/css/order.css
View file @
bb535407
...
...
@@ -266,4 +266,13 @@ input[type="color"],
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
margin-bottom
:
0
;
}
#payTime
{
float
:
left
;
margin-right
:
20px
;
}
.customArea
{
float
:
left
;
display
:
none
;
}
\ No newline at end of file
public/js/order.js
View file @
bb535407
...
...
@@ -1130,11 +1130,24 @@
}
})
// 选择付款时间
$
(
'#payTime'
).
change
(
function
(){
var
val
=
$
(
this
).
val
();
if
(
val
==
0
)
{
$
(
'.customArea'
).
show
();
}
else
{
$
(
'.customArea'
).
hide
();
}
})
// 提交表单
$
(
'.checkOrder'
).
click
(
function
(){
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
();
if
(
sale_id
==
null
)
{
layer
.
msg
(
'请选择业务员!'
);
...
...
@@ -1187,6 +1200,16 @@
return
false
;
}
if
(
payTime
==
''
)
{
layer
.
msg
(
'请选择付款时间'
);
return
false
;
}
if
(
payTime
==
0
&&
payTimeOther
==
''
)
{
layer
.
msg
(
'请填写自定义时间'
);
return
false
;
}
var
currencySign
=
currency
==
1
?
'¥'
:
'$'
;
var
goods_amount
=
currencySign
+
$
(
'input[name=goods_amount]'
).
val
();
var
order_amount
=
currencySign
+
$
(
'input[name=order_amount]'
).
val
();
...
...
resources/views/detail/changeOrder.blade.php
View file @
bb535407
...
...
@@ -73,6 +73,7 @@
</tr>
</table>
<hr/>
<!-- 调价 -->
<p>
调价
</p>
<table
class=
"table table-bordered table-hover order-change-table change-table"
>
...
...
@@ -126,6 +127,7 @@
</table>
<div
class=
"show-advance-pay"
>
<hr/>
<p>
定金调整
</p>
<table
class=
"table table-bordered table-hover change-table"
>
<tr>
...
...
@@ -147,6 +149,27 @@
</table>
</div>
<p>
付款时间
</p>
<table
class=
"table table-bordered table-hover change-table"
>
<tr>
<th>
选择付款时间
</th>
<td>
<select
name=
"payTime"
id=
"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=
"0"
>
其他
</option>
</select>
<div
class=
"customArea"
>
<input
type=
"text"
name=
"payTimeOther"
id=
"payTimeOther"
value=
""
style=
"width: 50px;"
>
天
<span
class=
"error"
>
(自定义天数,限制1~30)
</span>
</div>
</td>
</tr>
</table>
<a
class=
"btn btn-primary checkOrder"
>
提交
</a>
</form>
@endif
...
...
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