Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
semour
/
semour_admin
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
4396caee
authored
Nov 30, 2022
by
孙龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
订单相关
parent
ea852659
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
11 deletions
app/Admin/Controllers/Api/OrderApiController.php
app/Admin/Controllers/OrderController.php
app/helpers.php
public/assets/js/order/index.js
resources/views/admin/pages/order-page.blade.php
app/Admin/Controllers/Api/OrderApiController.php
View file @
4396caee
...
...
@@ -43,7 +43,7 @@ class OrderApiController extends BaseController
$info
[
"orderList"
][
"adminUser"
]
=
CmsUser
::
getInfoByUserId
(
$info
[
"orderList"
][
"sale_id"
]);
dump
(
$info
[
"orderList"
]);
//
dump($info["orderList"]);
if
(
$type
==
"1"
){
//PI
return
view
(
'export.order_contract_PI'
,[
...
...
@@ -87,7 +87,7 @@ class OrderApiController extends BaseController
$orderInfo
[
"orderItemList"
][
$k
][
"return_price"
]
=
$returnItems
[
"return_price"
]
??
""
;
$orderInfo
[
"orderItemList"
][
$k
][
"return_amount"
]
=
$returnItems
[
"return_amount"
]
??
""
;
$orderInfo
[
"orderItemList"
][
$k
][
"type"
]
=
$returnItems
[
"type"
]
??
""
;
$orderInfo
[
"orderItemList"
][
$k
][
"type_cn"
]
=
Arr
::
get
(
admin_trans
(
"order.options.order_return_type"
),
$returnItems
[
"type"
]
??
0
,
""
);
$orderInfo
[
"orderItemList"
][
$k
][
"type_cn"
]
=
Arr
::
get
(
admin_trans
_v2
(
"order.options.order_return_type"
),
$returnItems
[
"type"
]
??
0
,
""
);
}
$returnAmount
=
OrderService
::
getOrderReturnAmount
(
$order_id
);
...
...
@@ -157,12 +157,12 @@ class OrderApiController extends BaseController
'order_items.*.return_goods_number'
=>
'gt:0'
,
'order_items'
=>
'required'
,
],
[
'order_id.required'
=>
admin_trans
(
"order.validator.order_id_required"
),
'order_items.required'
=>
admin_trans
(
"order.validator.order_items_required"
),
'order_items.*.goods_price.gt'
=>
admin_trans
(
"order.validator.goods_price.gt"
),
'order_items.*.goods_number.gt'
=>
admin_trans
(
"order.validator.goods_number.gt"
),
'order_items.*.return_goods_price.gt'
=>
admin_trans
(
"order.validator.return_goods_price.gt"
),
'order_items.*.return_goods_number.gt'
=>
admin_trans
(
"order.validator.return_goods_number.gt"
),
'order_id.required'
=>
admin_trans
_v2
(
"order.validator.order_id_required"
),
'order_items.required'
=>
admin_trans
_v2
(
"order.validator.order_items_required"
),
'order_items.*.goods_price.gt'
=>
admin_trans
_v2
(
"order.validator.goods_price.gt"
),
'order_items.*.goods_number.gt'
=>
admin_trans
_v2
(
"order.validator.goods_number.gt"
),
'order_items.*.return_goods_price.gt'
=>
admin_trans
_v2
(
"order.validator.return_goods_price.gt"
),
'order_items.*.return_goods_number.gt'
=>
admin_trans
_v2
(
"order.validator.return_goods_number.gt"
),
],
[
// 'order_id' => '订单id',
...
...
@@ -183,8 +183,8 @@ class OrderApiController extends BaseController
'order_id'
=>
'required'
,
'order_address_type'
=>
'required'
,
],
[
'order_id.required'
=>
admin_trans
(
"order.validator.order_id_required"
),
'order_address_type.required'
=>
admin_trans
(
"order.validator.order_address.required"
),
'order_id.required'
=>
admin_trans
_v2
(
"order.validator.order_id_required"
),
'order_address_type.required'
=>
admin_trans
_v2
(
"order.validator.order_address.required"
),
],
[]);
if
(
$validator
->
fails
())
{
...
...
app/Admin/Controllers/OrderController.php
View file @
4396caee
...
...
@@ -313,6 +313,10 @@ JS
$lang
=
$GLOBALS
[
"app"
][
"config"
][
"admin"
][
"lang"
]
??
""
;
$info
[
"lang"
]
=
$lang
==
"zh_CN"
?
1
:
2
;
$info
[
"lang_str"
]
=
$lang
;
// dump($info);
// dd(user_admin_config("lang"));
return
view
(
'admin.pages.order-page'
,[
"info"
=>
$info
]);
}
...
...
app/helpers.php
View file @
4396caee
...
...
@@ -431,3 +431,9 @@ function buildQueryTimeRange($time = "")
$buildTimeQueryData
[
"end_time"
]
=
isset
(
$time
[
1
])
?
$time
[
1
]
:
""
;
return
$buildTimeQueryData
;
}
function
admin_trans_v2
(
$key
){
$lang
=
\Illuminate\Support\Facades\Cookie
::
get
(
"app_lang"
);
$lang
=
$lang
?
$lang
:
"en"
;
return
admin_trans
(
$key
,[],
$lang
);
}
public/assets/js/order/index.js
View file @
4396caee
...
...
@@ -17,7 +17,7 @@ layui.use(['form', 'table', 'laydate'], function () {
//列表
table
.
render
({
elem
:
'#list'
,
url
:
'/api/orderList
'
,
url
:
'/api/orderList
?lang='
+
lang_str
,
toolbar
:
'#toolbar'
,
method
:
'GET'
,
where
:
{
...
...
resources/views/admin/pages/order-page.blade.php
View file @
4396caee
...
...
@@ -441,6 +441,7 @@
<script>
var translation= <?php echo json_encode(
$info["translation"]
); ?>;
var lang = <?php echo
$info["lang"]
; ?>;
var lang_str = "
<?
php
echo
$info
[
"lang_str"
];
?>
";
</script>
<script
type=
"text/javascript"
src=
"/assets/js/order/index.js?v={{time()}}"
></script>
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