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
4c199afe
authored
Sep 03, 2018
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
添加自营对账
parent
8f5e01ff
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
125 additions
and
65 deletions
app/Http/Controllers/OrderController.php
app/Http/routes.php
config/perm.php
public/js/order.js
resources/views/detail/content.blade.php
resources/views/detail/selfCheckPay.blade.php
app/Http/Controllers/OrderController.php
View file @
4c199afe
...
@@ -905,7 +905,20 @@ Class OrderController extends Controller
...
@@ -905,7 +905,20 @@ Class OrderController extends Controller
{
{
$data
=
$this
->
orderDetail
(
$request
,
$id
);
$data
=
$this
->
orderDetail
(
$request
,
$id
);
if
(
$request
->
input
(
'tags'
)
==
'self'
)
{
if
(
$data
[
'order_info'
][
'order_goods_type'
]
==
2
)
{
if
(
$request
->
input
(
'tags'
)
!=
'self'
)
{
return
redirect
(
'self_order'
);
// URL重定向
}
else
{
$this
->
selfOtherData
(
$data
,
$id
);
}
}
return
view
(
$view_id
,
$data
);
}
// 详情页自营其他数据
public
function
selfOtherData
(
&
$data
,
$order_id
)
{
$shipping
=
DB
::
connection
(
'order'
)
->
table
(
'lie_shipping'
)
->
select
(
'shipping_id'
,
'shipping_name'
)
->
get
();
$shipping
=
DB
::
connection
(
'order'
)
->
table
(
'lie_shipping'
)
->
select
(
'shipping_id'
,
'shipping_name'
)
->
get
();
if
(
$shipping
)
{
if
(
$shipping
)
{
...
@@ -916,12 +929,11 @@ Class OrderController extends Controller
...
@@ -916,12 +929,11 @@ Class OrderController extends Controller
$data
[
'shippings'
]
=
$shippingInfo
;
$data
[
'shippings'
]
=
$shippingInfo
;
}
}
$extend
=
DB
::
connection
(
'order'
)
->
table
(
'lie_order_extend'
)
->
where
([
'order_id'
=>
$
id
,
'order_type'
=>
3
])
->
first
();
$extend
=
DB
::
connection
(
'order'
)
->
table
(
'lie_order_extend'
)
->
where
([
'order_id'
=>
$order_
id
,
'order_type'
=>
3
])
->
first
();
$data
[
'extend'
]
=
$extend
?
$extend
:
''
;
$data
[
'extend'
]
=
$extend
?
$extend
:
''
;
}
return
view
(
$view_id
,
$data
)
;
return
$data
;
}
}
// 外部引用
// 外部引用
...
@@ -1313,47 +1325,6 @@ Class OrderController extends Controller
...
@@ -1313,47 +1325,6 @@ Class OrderController extends Controller
}
}
}
}
/**
* webPower 短信商
* @param $mobile 手机号码
* @param $content 短信内容
* @return bool
*/
public
function
webpower_send_sms
(
$mobile
,
$content
,
$campaignID
=
1424
)
{
//webservice
// $url = "http://lx.webpowerchina.cn/sms/rest/v1/sms"; //输出的链接地址
$url
=
'https://sms.dmavip.com/rest/v2/single_sms'
;
$post_data
=
array
(
'mobile'
=>
$mobile
,
'content'
=>
$content
,
'campaignID'
=>
$campaignID
,
);
//填写参数,mobile手机号码,content短信内容,campaignID活动id(短信平台上面发送一般是在活动下面,跟邮件一样会有一个活动Id)
$data
=
webpower_curl
(
$url
,
$post_data
);
if
(
isset
(
$data
)){
//保存验证码
DB
::
connection
(
'order'
)
->
table
(
'lie_msg_send'
)
->
insert
([
'mobile'
=>
$mobile
,
'code'
=>
' '
,
'send_time'
=>
time
(),
'url'
=>
$url
.
'?'
.
http_build_query
(
$post_data
),
'response'
=>
$data
]);
$result
=
json_decode
(
$data
,
true
);
$status
=
strtoupper
(
$result
[
'status'
]);
if
(
$status
==
'OK'
){
return
true
;
}
else
{
return
false
;
}
}
else
{
return
false
;
}
}
//取消订单(仅限审核通过,未付款前)
//取消订单(仅限审核通过,未付款前)
public
function
cancelPay
(
Request
$request
,
$id
)
public
function
cancelPay
(
Request
$request
,
$id
)
{
{
...
@@ -1706,26 +1677,37 @@ Class OrderController extends Controller
...
@@ -1706,26 +1677,37 @@ Class OrderController extends Controller
}
}
}
}
/**
// 自营对账
* 锁定基石库存
public
function
selfCheckPay
(
Request
$request
,
$id
)
* @return [type] [description]
*/
protected
function
unlockSku
(
$order_id
,
$skus
=
array
(),
$reduce
=
false
)
{
{
$datas
=
array
(
if
(
$request
->
isMethod
(
'post'
))
{
'order_id'
=>
$order_id
,
$order_id
=
$request
->
input
(
'order_id'
,
''
);
'Items'
=>
$skus
,
$serial_number
=
$request
->
input
(
'serial_number'
,
''
);
'reduce'
=>
$reduce
,
$operator_id
=
$request
->
user
->
userId
;
);
$data
[
'type'
]
=
'sku.unlock'
;
$url
=
Config
(
'website.api_domain'
)
.
'order/selfcheckpay'
;
$data
[
'data'
]
=
urlencode
(
json_encode
(
$datas
));
$data
[
'timestamp'
]
=
time
();
$data
[
'order_id'
]
=
$order_id
;
$res
=
webpower_curl
(
Config
(
'website.SERVICE_DOMAIN'
)
.
'/transpond/wmsapi/WebApiUnlockStock?token='
.
service_token
(
$data
[
'data'
],
$data
[
'timestamp'
]),
$data
);
$data
[
'serial_number'
]
=
$serial_number
;
// $res = post_curl(STONE_DOMAIN.'/wmsapi/WebApiUnlockStock?token='.service_token($data['data'], $data['timestamp']), $data);
$data
[
'operator_id'
]
=
$operator_id
;
if
(
!
empty
(
$res
))
{
$res
=
json_decode
(
$res
,
true
);
$data
[
'k1'
]
=
time
();
}
$data
[
'k2'
]
=
md5
(
md5
(
$data
[
'k1'
])
.
'fh6y5t4rr351d2c3bryi'
);
return
$res
;
$temp
=
json_decode
(
curlApi
(
$url
,
$data
,
"POST"
),
true
);
// 连接API
if
(
$temp
[
'err_code'
]
==
0
)
{
return
array
(
'errcode'
=>
0
,
'errmsg'
=>
'操作成功'
);
}
else
{
errorLog
(
Error
::
E_UPDATE_FAILED
,
'操作失败'
);
return
array
(
'errcode'
=>
Error
::
E_UPDATE_FAILED
,
'errmsg'
=>
'操作失败'
);
}
}
$info
=
$this
->
orderDetail
(
$request
,
$id
);
$this
->
selfOtherData
(
$info
,
$id
);
return
view
(
'detail'
,
$info
);
}
}
// 快递配置
// 快递配置
...
...
app/Http/routes.php
View file @
4c199afe
...
@@ -66,6 +66,7 @@ Route::group(['middleware' => 'web'], function () {
...
@@ -66,6 +66,7 @@ Route::group(['middleware' => 'web'], function () {
Route
::
get
(
'/self_order'
,
'OrderController@selfOrder'
);
Route
::
get
(
'/self_order'
,
'OrderController@selfOrder'
);
Route
::
post
(
'/ajaxSelfCancel'
,
'OrderController@ajaxSelfCancel'
);
Route
::
post
(
'/ajaxSelfCancel'
,
'OrderController@ajaxSelfCancel'
);
Route
::
post
(
'/ajaxSelfExpress'
,
'OrderController@ajaxSelfExpress'
);
Route
::
post
(
'/ajaxSelfExpress'
,
'OrderController@ajaxSelfExpress'
);
Route
::
match
([
'get'
,
'post'
],
'/self_check_pay/{id}'
,
'OrderController@selfCheckPay'
);
Route
::
match
(
'post'
,
'/ajaxDelayTime'
,
'OrderController@ajaxDelayTime'
);
Route
::
match
(
'post'
,
'/ajaxDelayTime'
,
'OrderController@ajaxDelayTime'
);
...
...
config/perm.php
View file @
4c199afe
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
],
],
'自营订单'
=>
[
'自营订单'
=>
[
'订单列表'
=>
[
'self_order_check'
,
'self_order_export'
,
'self_order_cancel'
,
'self_order_express'
,
'self_order_invoice_express'
,
'self_order_update_address'
,
'self_order_update_invoice'
,
'self_check_test_order'
,
'self_order_download_contract'
],
'订单列表'
=>
[
'self_order_check'
,
'self_order_export'
,
'self_order_cancel'
,
'self_order_express'
,
'self_order_invoice_express'
,
'self_order_update_address'
,
'self_order_update_invoice'
,
'self_check_test_order'
,
'self_order_download_contract'
,
'self_check_pay'
],
'快递配置'
=>
[
'self_order_express_set_check'
],
'快递配置'
=>
[
'self_order_express_set_check'
],
...
...
public/js/order.js
View file @
4c199afe
...
@@ -1543,6 +1543,47 @@
...
@@ -1543,6 +1543,47 @@
}
}
});
});
})
})
// 自营对账
$
(
'.self-sure-pay'
).
click
(
function
(){
var
order_id
=
$
(
'#order_id'
).
val
();
var
serial_number
=
$
(
'input[name="serial_number"]'
).
val
();
if
(
serial_number
.
length
==
0
)
{
layer
.
alert
(
'请输入流水号'
);
return
false
;
}
layer
.
open
({
title
:
'收款确认'
,
content
:
'请仔细核对订单金额后确认'
,
btn
:[
'确认'
,
'取消'
],
btn1
:
function
(){
$
.
ajax
({
url
:
'/self_check_pay/'
+
order_id
,
data
:
{
order_id
:
order_id
,
serial_number
:
serial_number
},
type
:
'post'
,
dataType
:
'json'
,
success
:
function
(
resp
){
if
(
resp
.
errcode
==
0
){
layer
.
msg
(
resp
.
errmsg
);
location
.
reload
();
return
false
;
}
else
{
layer
.
alert
(
resp
.
errmsg
);
}
},
error
:
function
(){
layer
.
alert
(
'网络异常'
);
}
});
},
btn2
:
function
(){
return
true
;
}
})
})
},
},
}
}
...
...
resources/views/detail/content.blade.php
View file @
4c199afe
...
@@ -539,6 +539,11 @@
...
@@ -539,6 +539,11 @@
@include('detail.check')
@include('detail.check')
@endif
@endif
@if ($action_name == 'selfCheckPay')
<!--自营对账-->
@include('detail.selfCheckPay')
@endif
<!-- 人工审单时去掉操作按钮 -->
<!-- 人工审单时去掉操作按钮 -->
@if (!isset($_REQUEST['tags'])
&&
$action_name != 'changeOrder'
&&
$action_name != 'sendSales')
@if (!isset($_REQUEST['tags'])
&&
$action_name != 'changeOrder'
&&
$action_name != 'sendSales')
<p
style=
"padding-left: 5px;"
>
操作
</p>
<p
style=
"padding-left: 5px;"
>
操作
</p>
...
@@ -583,6 +588,10 @@
...
@@ -583,6 +588,10 @@
<a
class=
"btn btn-default self_cancel"
href=
"javascript:;"
data-id=
"{{$order_info['order_id']}}"
class=
"btn btn-default"
>
取消订单
</a>
<a
class=
"btn btn-default self_cancel"
href=
"javascript:;"
data-id=
"{{$order_info['order_id']}}"
class=
"btn btn-default"
>
取消订单
</a>
@endif
@endif
@if ($order_info['status'] == 2
&&
in_array('self_check_pay', $userPerms))
<a
href=
"/self_check_pay/{{$order_info['order_id']}}?tags=self"
class=
"btn btn-default"
>
对账
</a>
@endif
@if ($order_info['status'] == 4
&&
in_array('self_order_express', $userPerms))
@if ($order_info['status'] == 4
&&
in_array('self_order_express', $userPerms))
<a
class=
"btn btn-default self_express"
href=
"javascript:;"
data-id=
"{{$order_info['order_id']}}"
class=
"btn btn-default"
>
填写快递单
</a>
<a
class=
"btn btn-default self_express"
href=
"javascript:;"
data-id=
"{{$order_info['order_id']}}"
class=
"btn btn-default"
>
填写快递单
</a>
@endif
@endif
...
...
resources/views/detail/selfCheckPay.blade.php
0 → 100644
View file @
4c199afe
<p
style=
"margin-left: 5px;"
>
对账操作
</p>
<div
class=
"tabs-box"
>
<!-- 判断订单类型 1.全款,2.预付款 -->
<?php
if
(
$order_info
[
'status'
]
==
4
)
{
echo
'<p>订单对账正常</p>
<p>流水号:'
.
$order_pay_log
[
0
][
'serial_number'
]
.
'</p>
<p class="error">订单总金额:'
.
$order_info
[
'order_amount'
]
.
'</p>'
;
}
else
{
$serial_number
=
isset
(
$order_pay_log
[
0
][
'serial_number'
])
?
$order_pay_log
[
0
][
'serial_number'
]
:
''
;
echo
'<p><a class="btn btn-default self-sure-pay">确认收款</a></p>
<p> 流水号:
<input style="width: 200px;" type="text" name="serial_number" value="'
.
$serial_number
.
'">
<span style="color:orange;">请录入流水号,流水号为英文、数字</span>
</p>
<p class="error">订单总金额:'
.
$order_info
[
'order_amount'
]
.
'</p>'
;
}
?>
</div>
<div
class=
"hide"
id=
"sure-pay"
>
<p><label><input
type=
"radio"
name=
"status"
value=
"1"
checked
>
款项正常
</label></p>
<p><label><input
type=
"radio"
name=
"status"
value=
"2"
>
款项异常
</label></p>
<p><textarea
name=
"info"
placeholder=
"请填写异常原因"
></textarea></p>
</div>
\ 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