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
6936fc36
authored
Jan 13, 2021
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
添加售后数量
parent
9c943632
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
5 deletions
app/Http/Controllers/ApiController.php
app/Model/OrderServiceModel.php
public/js/web/orderServiceList.js
resources/views/web/orderServiceList.blade.php
app/Http/Controllers/ApiController.php
View file @
6936fc36
...
...
@@ -448,6 +448,13 @@ class ApiController extends Controller
$this
->
Export
(
$OrderServiceModel
->
action
(
$request
));
}
// 获取售后数量
public
function
ApiOrderServicedNum
(
$request
)
{
$OrderServiceModel
=
new
OrderServiceModel
;
$this
->
Export
(
$OrderServiceModel
->
getServicedNum
(
$request
));
}
// 售后单编辑
public
function
ApiOrderServiceEdit
(
$request
)
{
...
...
app/Model/OrderServiceModel.php
View file @
6936fc36
...
...
@@ -171,7 +171,7 @@ class OrderServiceModel extends Model
$post
[
'operator_id'
]
=
$request
->
user
->
userId
;
$url
=
Config
(
'website.api_domain'
)
.
'refund/apply'
;
dd
(
curlApi
(
$url
,
$post
,
'POST'
));
$res
=
json_decode
(
curlApi
(
$url
,
$post
,
'POST'
),
true
);
if
(
!
$res
||
$res
[
'err_code'
]
!=
0
)
return
[
-
2
,
'审核通过生成退款单失败,原因:'
.
$res
[
'err_msg'
]];
...
...
@@ -232,5 +232,31 @@ class OrderServiceModel extends Model
return
[
0
,
'成功'
];
}
// 获取已售后数量
public
function
getServicedNum
(
$request
)
{
$order_id
=
$request
->
input
(
'order_id'
,
0
);
$data
=
$this
->
from
(
'lie_order_service as s'
)
->
leftJoin
(
'lie_order_service_items as i'
,
's.id'
,
'='
,
'i.service_id'
)
->
where
(
's.service_status'
,
'>'
,
1
)
->
where
(
'i.order_id'
,
$order_id
)
->
select
(
'goods_id'
,
'adjust_number'
)
->
get
()
->
toArray
();
if
(
empty
(
$data
))
return
[
0
,
''
,
$data
];
$goods
=
[];
foreach
(
$data
as
$v
)
{
if
(
isset
(
$goods
[
$v
[
'goods_id'
]]
))
{
$goods
[
$v
[
'goods_id'
]]
+=
$v
[
'adjust_number'
];
}
else
{
$goods
[
$v
[
'goods_id'
]]
=
$v
[
'adjust_number'
];
}
}
return
[
0
,
''
,
$goods
];
}
}
\ No newline at end of file
public/js/web/orderServiceList.js
View file @
6936fc36
...
...
@@ -109,6 +109,23 @@ layui.use(['form', 'table', 'laydate'], function(){
$
(
'.bank_sub_name'
).
val
(
data
.
bank_sub_name
);
}
// 获取售后数量
var
serviced_num
=
[];
$
.
ajax
({
url
:
'/api/ApiOrderServicedNum'
,
type
:
'post'
,
data
:
{
order_id
:
data
.
order_id
},
dataType
:
'json'
,
async
:
false
,
success
:
function
(
resp
)
{
if
(
resp
.
data
)
serviced_num
=
resp
.
data
;
},
error
:
function
(
err
)
{
console
.
log
(
err
)
}
})
var
html
=
''
;
var
items
=
data
.
items
;
var
len
=
items
.
length
;
...
...
@@ -121,7 +138,7 @@ layui.use(['form', 'table', 'laydate'], function(){
<td class="origin-goods-number">'
+
items
[
i
].
goods_number
+
'</td>\
<td class="fqty">'
+
items
[
i
].
removal_number
+
'</td>\
<td class="single_pre_price">'
+
items
[
i
].
single_pre_price
+
'</td>\
<td class="service-goods-number"></td>'
;
<td class="service-goods-number">
'
+
(
serviced_num
[
items
[
i
].
goods_id
]
??
0
)
+
'
</td>'
;
if
(
items
[
i
].
adjust_number
!=
0
)
{
html
+=
'<td><input type="text" class="form-control adjust_number" name="service_item['
+
items
[
i
].
id
+
'][adjust_number]" value="'
+
items
[
i
].
adjust_number
+
'"></td>'
;
...
...
resources/views/web/orderServiceList.blade.php
View file @
6936fc36
...
...
@@ -136,8 +136,6 @@
<script>
var
apply_reason
=
eval
(
'('
+
'{!! json_encode(Config("order_service.apply_reason")) !!}'
+
')'
);
console
.
log
(
apply_reason
)
console
.
log
(
apply_reason
.
length
)
</script>
@include('common.order_service')
\ 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