Commit 4396caee by 孙龙

订单相关

parent ea852659
...@@ -43,7 +43,7 @@ class OrderApiController extends BaseController ...@@ -43,7 +43,7 @@ class OrderApiController extends BaseController
$info["orderList"]["adminUser"] = CmsUser::getInfoByUserId($info["orderList"]["sale_id"]); $info["orderList"]["adminUser"] = CmsUser::getInfoByUserId($info["orderList"]["sale_id"]);
dump($info["orderList"]); // dump($info["orderList"]);
if($type == "1"){ if($type == "1"){
//PI //PI
return view('export.order_contract_PI',[ return view('export.order_contract_PI',[
...@@ -87,7 +87,7 @@ class OrderApiController extends BaseController ...@@ -87,7 +87,7 @@ class OrderApiController extends BaseController
$orderInfo["orderItemList"][$k]["return_price"] = $returnItems["return_price"] ?? ""; $orderInfo["orderItemList"][$k]["return_price"] = $returnItems["return_price"] ?? "";
$orderInfo["orderItemList"][$k]["return_amount"] = $returnItems["return_amount"] ?? ""; $orderInfo["orderItemList"][$k]["return_amount"] = $returnItems["return_amount"] ?? "";
$orderInfo["orderItemList"][$k]["type"] = $returnItems["type"] ?? ""; $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); $returnAmount = OrderService::getOrderReturnAmount($order_id);
...@@ -157,12 +157,12 @@ class OrderApiController extends BaseController ...@@ -157,12 +157,12 @@ class OrderApiController extends BaseController
'order_items.*.return_goods_number' => 'gt:0', 'order_items.*.return_goods_number' => 'gt:0',
'order_items' => 'required', 'order_items' => 'required',
], [ ], [
'order_id.required' => admin_trans("order.validator.order_id_required"), 'order_id.required' => admin_trans_v2("order.validator.order_id_required"),
'order_items.required' => admin_trans("order.validator.order_items_required"), 'order_items.required' => admin_trans_v2("order.validator.order_items_required"),
'order_items.*.goods_price.gt' => admin_trans("order.validator.goods_price.gt"), 'order_items.*.goods_price.gt' => admin_trans_v2("order.validator.goods_price.gt"),
'order_items.*.goods_number.gt' => admin_trans("order.validator.goods_number.gt"), 'order_items.*.goods_number.gt' => admin_trans_v2("order.validator.goods_number.gt"),
'order_items.*.return_goods_price.gt' => admin_trans("order.validator.return_goods_price.gt"), 'order_items.*.return_goods_price.gt' => admin_trans_v2("order.validator.return_goods_price.gt"),
'order_items.*.return_goods_number.gt' => admin_trans("order.validator.return_goods_number.gt"), 'order_items.*.return_goods_number.gt' => admin_trans_v2("order.validator.return_goods_number.gt"),
], [ ], [
// 'order_id' => '订单id', // 'order_id' => '订单id',
...@@ -183,8 +183,8 @@ class OrderApiController extends BaseController ...@@ -183,8 +183,8 @@ class OrderApiController extends BaseController
'order_id' => 'required', 'order_id' => 'required',
'order_address_type' => 'required', 'order_address_type' => 'required',
], [ ], [
'order_id.required' => admin_trans("order.validator.order_id_required"), 'order_id.required' => admin_trans_v2("order.validator.order_id_required"),
'order_address_type.required' => admin_trans("order.validator.order_address.required"), 'order_address_type.required' => admin_trans_v2("order.validator.order_address.required"),
], []); ], []);
if ($validator->fails()) { if ($validator->fails()) {
......
...@@ -313,6 +313,10 @@ JS ...@@ -313,6 +313,10 @@ JS
$lang = $GLOBALS["app"]["config"]["admin"]["lang"] ?? ""; $lang = $GLOBALS["app"]["config"]["admin"]["lang"] ?? "";
$info["lang"] = $lang == "zh_CN" ? 1 : 2; $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]); return view('admin.pages.order-page',["info"=>$info]);
} }
......
...@@ -431,3 +431,9 @@ function buildQueryTimeRange($time = "") ...@@ -431,3 +431,9 @@ function buildQueryTimeRange($time = "")
$buildTimeQueryData["end_time"] = isset($time[1]) ? $time[1] : ""; $buildTimeQueryData["end_time"] = isset($time[1]) ? $time[1] : "";
return $buildTimeQueryData; return $buildTimeQueryData;
} }
function admin_trans_v2($key){
$lang = \Illuminate\Support\Facades\Cookie::get("app_lang");
$lang = $lang ? $lang : "en";
return admin_trans($key,[],$lang);
}
...@@ -17,7 +17,7 @@ layui.use(['form', 'table', 'laydate'], function () { ...@@ -17,7 +17,7 @@ layui.use(['form', 'table', 'laydate'], function () {
//列表 //列表
table.render({ table.render({
elem: '#list', elem: '#list',
url: '/api/orderList', url: '/api/orderList?lang='+lang_str,
toolbar: '#toolbar', toolbar: '#toolbar',
method: 'GET', method: 'GET',
where: { where: {
......
...@@ -441,6 +441,7 @@ ...@@ -441,6 +441,7 @@
<script> <script>
var translation= <?php echo json_encode($info["translation"]); ?>; var translation= <?php echo json_encode($info["translation"]); ?>;
var lang = <?php echo $info["lang"]; ?>; var lang = <?php echo $info["lang"]; ?>;
var lang_str = "<?php echo $info["lang_str"]; ?>";
</script> </script>
<script type="text/javascript" src="/assets/js/order/index.js?v={{time()}}"></script> <script type="text/javascript" src="/assets/js/order/index.js?v={{time()}}"></script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment