Commit a6ca6bff by LJM

Merge branch 'master' of http://git.ichunt.net/semour/semour_admin

# Conflicts:
#	resources/views/admin/pages/order-page.blade.php
parents 9942b2fc 859f928d
...@@ -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]);
} }
......
...@@ -138,10 +138,9 @@ class OrderService extends BaseService ...@@ -138,10 +138,9 @@ class OrderService extends BaseService
if(!empty($returnItems)){ if(!empty($returnItems)){
foreach($insertReturnItemData as $field=>$val){ foreach($insertReturnItemData as $field=>$val){
if($field == "type" && !in_array($val["type"],[1,2])){ if($field != "type" || !in_array($val,[1,2])){
continue; continue;
} }
if($field == "return_goods_number" && !$val){ if($field == "return_goods_number" && !$val){
continue; continue;
} }
...@@ -166,6 +165,7 @@ class OrderService extends BaseService ...@@ -166,6 +165,7 @@ class OrderService extends BaseService
if($createOrEdit){ if($createOrEdit){
$insertReturnItemData["return_amount"] = decimal_number_format($insertReturnItemData["return_price"] * $insertReturnItemData["return_num"]); $insertReturnItemData["return_amount"] = decimal_number_format($insertReturnItemData["return_price"] * $insertReturnItemData["return_num"]);
} }
$createOrEdit && OrderReturnItems::create(array_merge($insertReturnItemData,["create_time"=>time()])); $createOrEdit && OrderReturnItems::create(array_merge($insertReturnItemData,["create_time"=>time()]));
} }
...@@ -287,6 +287,8 @@ class OrderService extends BaseService ...@@ -287,6 +287,8 @@ class OrderService extends BaseService
if(empty($orderInfo)){ if(empty($orderInfo)){
throw new InvalidRequestException(admin_trans("order.return_msg.50005")); throw new InvalidRequestException(admin_trans("order.return_msg.50005"));
} }
$freightCharge = $freightCharge <= 0 ? 0 : $freightCharge;
$payCommission = $payCommission <= 0 ? 0 : $payCommission;
OrderPrice::editOrderSettlement($orderId,$orderInfo["order_sn"],$freightCharge,$payCommission); OrderPrice::editOrderSettlement($orderId,$orderInfo["order_sn"],$freightCharge,$payCommission);
Order::updateOrder(["order_id"=>$orderId],[ Order::updateOrder(["order_id"=>$orderId],[
"order_user_pay_type"=>$orderUserPayType, "order_user_pay_type"=>$orderUserPayType,
......
...@@ -33,6 +33,8 @@ use Dcat\Admin\Show\Field; ...@@ -33,6 +33,8 @@ use Dcat\Admin\Show\Field;
config(['admin' => user_admin_config()]); config(['admin' => user_admin_config()]);
config(['app.locale' => config('admin.lang') ?: config('app.locale')]); config(['app.locale' => config('admin.lang') ?: config('app.locale')]);
setcookie('app_lang', config('admin.lang') ?: config('app.locale'));
$primaryColor = Admin::color()->primary(); $primaryColor = Admin::color()->primary();
$primaryColor = '#009688'; $primaryColor = '#009688';
......
...@@ -37,8 +37,6 @@ class OrderPrice extends Model ...@@ -37,8 +37,6 @@ class OrderPrice extends Model
//新增或者修改订单的 运费 支付手续费 //新增或者修改订单的 运费 支付手续费
public static function editOrderSettlement($orderId,$orderSn,$freightCharge,$payCommission){ public static function editOrderSettlement($orderId,$orderSn,$freightCharge,$payCommission){
if($freightCharge){
self::updateOrCreate([ self::updateOrCreate([
"order_id"=>$orderId, "order_id"=>$orderId,
"price_type"=>self::$PRICE_TYPE_LIST["运费"], "price_type"=>self::$PRICE_TYPE_LIST["运费"],
...@@ -48,9 +46,8 @@ class OrderPrice extends Model ...@@ -48,9 +46,8 @@ class OrderPrice extends Model
"currency"=>2, "currency"=>2,
"create_time"=>time(), "create_time"=>time(),
]); ]);
}
if($payCommission){
self::updateOrCreate([ self::updateOrCreate([
"order_id"=>$orderId, "order_id"=>$orderId,
"price_type"=>self::$PRICE_TYPE_LIST["支付手续费"], "price_type"=>self::$PRICE_TYPE_LIST["支付手续费"],
...@@ -60,7 +57,7 @@ class OrderPrice extends Model ...@@ -60,7 +57,7 @@ class OrderPrice extends Model
"currency"=>2, "currency"=>2,
"create_time"=>time(), "create_time"=>time(),
]); ]);
}
} }
......
...@@ -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: {
......
...@@ -10,7 +10,7 @@ return [ ...@@ -10,7 +10,7 @@ return [
'fields' => [ 'fields' => [
'inquiry_id' => 'Id', 'inquiry_id' => 'Id',
'sales_name' => 'Sales Name', 'sales_name' => 'Sales Name',
'inquiry_sn' => 'Inquiry Sn', 'inquiry_sn' => 'Inquiry No',
'status' => 'Status', 'status' => 'Status',
'remark' => 'Remark', 'remark' => 'Remark',
'priority' => 'Priority', 'priority' => 'Priority',
...@@ -21,6 +21,7 @@ return [ ...@@ -21,6 +21,7 @@ return [
'email' => 'email', 'email' => 'email',
'user' => [ 'user' => [
'phone' => 'Phone', 'phone' => 'Phone',
'user_sn' => 'Customer No',
], ],
'sales_user' => [ 'sales_user' => [
'name' => 'Sales Name', 'name' => 'Sales Name',
......
...@@ -423,10 +423,10 @@ ...@@ -423,10 +423,10 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">{{admin_trans("order.order_page.支付方式")}}:</label> <label class="layui-form-label">{{admin_trans("order.order_page.支付方式")}}:</label>
<div class="layui-input-block"> <div class="layui-input-block">
<div class="layui-form-mid">{{$info["settlementInfo"]["order_user_pay_type_cn"]}}</div> <div class="layui-form-mid">{{$info["settlementInfo"]["order_user_pay_type_cn"]}} </div>
<div class="show" style="display: none"> <div class="show" style="display: none">
<input type="radio" name="order_user_pay_type" value="1" title="Paypal" checked> <input type="radio" name="order_user_pay_type" value="1" title="Paypal" @if($info["settlementInfo"]["order_user_pay_type"] == "1") checked @endif >
<input type="radio" name="order_user_pay_type" value="2" title="TT"> <input type="radio" name="order_user_pay_type" value="2" @if($info["settlementInfo"]["order_user_pay_type"] == "2") checked @endif title="TT">
</div> </div>
</div> </div>
</div> </div>
...@@ -451,6 +451,7 @@ ...@@ -451,6 +451,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>
<table border="1"> <table border="1">
<tr> <tr>
<td rowspan="4"> <td rowspan="4">
<img src="./assets/images/logo.png" width="50" height="50" >
</td> </td>
</tr> </tr>
......
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