Commit 645b8758 by 杨树贤

Merge branch 'dev/ver/1.0.0' of http://git.ichunt.net/semour/semour_web into dev/ver/1.0.0

parents deb6fbcc 31a96d68
...@@ -61,6 +61,8 @@ class OrderService ...@@ -61,6 +61,8 @@ class OrderService
"user_id"=>$user_id, "user_id"=>$user_id,
"creator_uid"=>$user_id, "creator_uid"=>$user_id,
"company_name"=>$userInfo["company_name"], "company_name"=>$userInfo["company_name"],
"sale_id"=>$userInfo["sale_id"],
"sale_name"=>$userInfo["sale_name"],
"exchange_rate"=>getRate(), "exchange_rate"=>getRate(),
"currency"=>2, "currency"=>2,
"create_time"=>time(), "create_time"=>time(),
...@@ -285,45 +287,52 @@ class OrderService ...@@ -285,45 +287,52 @@ class OrderService
$result = $res["data"]; $result = $res["data"];
$orderAddressArr = OrderAddressModel::where("order_address_type",1)->whereIn("order_id", array_column($result, "order_id"))->get()->keyBy("order_id")->toArray(); //地址信息 $orderAddressArr = OrderAddressModel::whereIn("order_id", array_column($result, "order_id"))->get()->keyBy("order_address_type")->toArray(); //地址信息
$temp = []; $temp = [];
foreach ($result as $k=>$v){ foreach ($result as $k=>$v){
$order_id = $v["order_id"]; $order_id = $v["order_id"];
$items = OrderItemsModel::where("order_id",$order_id)->get()->toArray(); $items = OrderItemsModel::where("order_id",$order_id)->get()->toArray();
$orderAddress = \Arr::get($orderAddressArr,$order_id,[]); $receiveAddress = \Arr::get($orderAddressArr,OrderAddressModel::order_address_type_receive,[]);
$piaoAddress = \Arr::get($orderAddressArr,OrderAddressModel::order_address_type_piao,[]);
$merchandise_total = 0; //商品总额 $merchandise_total = 0; //商品总额
foreach ($items as $a=>$b){ foreach ($items as $a=>$b){
$ext_price = round($b["goods_number"]*$b["goods_price"],2); $ext_price = round($b["goods_number"]*$b["goods_price"],2);
$merchandise_total += $ext_price; $merchandise_total += $ext_price;
} }
$merchandise_total = round($merchandise_total,2);
$priceInfo = OrderPriceModel::selectRaw("price_type,price") $priceInfo = OrderPriceModel::selectRaw("price_type,price")
->where("order_id",$order_id) ->where("order_id",$order_id)
->get()->toArray(); //金额类型(正数ID大于0,负数ID小于0)-8活动优惠 -7支付优惠 -6运费优惠 -5尾款减款 -4优惠券优惠金额 -3尾款 -2预付款 -1付款,1货款 2附加费 3运费 4退款 5支付手续费 ->get()->toArray(); //金额类型(正数ID大于0,负数ID小于0)-8活动优惠 -7支付优惠 -6运费优惠 -5尾款减款 -4优惠券优惠金额 -3尾款 -2预付款 -1付款,1货款 2附加费 3运费 4退款 5支付手续费
$priceArr = array_column($priceInfo,"price","price_type"); $priceArr = array_column($priceInfo,"price","price_type");
# $sub_total = OrderPriceModel::getOrderSubTotal($order_id);
$payment_surcharge_paypal = round($merchandise_total*0.046+0.5,2);
$temp[]=[ $ts =[
"order_id"=>$order_id, "order_id"=>$order_id,
"order_sn"=>$v["order_sn"], "order_sn"=>$v["order_sn"],
"order_amount"=>$v["order_amount"], "order_amount"=>$v["order_amount"],
"goods_name_arr"=>array_column($items,"goods_name"), "goods_name_arr"=>array_column($items,"goods_name"),
"status"=>$v["status"], "status"=>$v["status"],
"status_en"=>\Arr::get(OrderModel::$status,$v["status"],""), "status_en"=>\Arr::get(OrderModel::$status,$v["status"],""),
"receiver"=>\Arr::get($orderAddress,"consignee"), "receiver"=>\Arr::get($receiveAddress,"consignee"),
"email"=>\Arr::get($orderAddress,"email"), "email"=>\Arr::get($receiveAddress,"email"),
"phone"=>\Arr::get($orderAddress,"phone"), "phone"=>\Arr::get($receiveAddress,"phone"),
"shipping_address"=>\Arr::get($orderAddress,"detail_address"), "shipping_address"=>\Arr::get($receiveAddress,"detail_address"),
"shipping"=>\Arr::get($priceArr,3,0), //运费 "shipping"=>\Arr::get($priceArr,3,0), //运费
"payment_surcharge"=>\Arr::get($priceArr,5,0), //支付手续费 "payment_surcharge_paypal"=>$payment_surcharge_paypal, //paypal 支付手续费
"payment_surcharge_ttl"=>35, //ttl 支付手续费
"merchandise_total"=>$merchandise_total, //商品总额 "merchandise_total"=>$merchandise_total, //商品总额
"sub_total"=>OrderPriceModel::getOrderSubTotal($order_id), //小计
"create_time"=>date('Y-m-d H:i:s', $v['create_time']), //下单时间 "create_time"=>date('Y-m-d H:i:s', $v['create_time']), //下单时间
# "over_time"=> $v["status"] == OrderModel::status_waiting_pay ? date('Y-m-d H:i:s', $v['create_time']+48*3600):"", //截止时间
"over_time"=> date('Y-m-d H:i:s', $v['create_time']+48*3600), //截止时间 "over_time"=> date('Y-m-d H:i:s', $v['create_time']+48*3600), //截止时间
]; ];
$ts["sub_total_payal"] = round($ts["payment_surcharge_paypal"]+$merchandise_total+$ts["shipping"],2); //paypal 小计
$ts["sub_total_ttl"] = round($ts["payment_surcharge_ttl"]+$merchandise_total+$ts["shipping"],2); //ttl 小计
$temp[] = $ts;
} }
#统计当前用户各个状态数量 #统计当前用户各个状态数量
......
...@@ -10,6 +10,10 @@ class OrderAddressModel extends Model ...@@ -10,6 +10,10 @@ class OrderAddressModel extends Model
protected $primaryKey = 'order_address_id'; protected $primaryKey = 'order_address_id';
public $timestamps = false; public $timestamps = false;
// `order_address_type` '1收货信息 2账单邮寄信息',
const order_address_type_receive = 1;
const order_address_type_piao = 2;
//获取订单地址详情 //获取订单地址详情
public static function getOrderAddressInfo($where) public static function getOrderAddressInfo($where)
{ {
......
...@@ -16,7 +16,7 @@ define('class_p', ['tool', 'liexin_pop', 'artTemplate', 'pagination'], function ...@@ -16,7 +16,7 @@ define('class_p', ['tool', 'liexin_pop', 'artTemplate', 'pagination'], function
page: class_p.page, page: class_p.page,
page_size: class_p.limit, page_size: class_p.limit,
"class_id1/eq": $("#class_id_two").val(), "class_id1/eq": $("#class_id_two").val(),
"brand_name/like": $(".brandvals").val() "semour_brand/like": $(".brandvals").val()
} }
if ($(".eqsort").hasClass("act")) { if ($(".eqsort").hasClass("act")) {
data_["goods_name/eq"] = $(".classsearchvals").val() data_["goods_name/eq"] = $(".classsearchvals").val()
......
...@@ -118,9 +118,11 @@ define('order', ['tool', 'liexin_pop', 'artTemplate', 'pagination'], function (r ...@@ -118,9 +118,11 @@ define('order', ['tool', 'liexin_pop', 'artTemplate', 'pagination'], function (r
$(".merchandise_pay").text(self.attr("merchandise_pay")) $(".merchandise_pay").text(self.attr("merchandise_pay"))
$(".shipping_pay").text(self.attr("shipping_pay")) $(".shipping_pay").text(self.attr("shipping_pay"))
$(".ps_pay").text(self.attr("ps_pay")) $(".ps_pay.ppbox").text(self.attr("ps_pay"))
$(".ps_pay.ttbox").text(self.attr("ps_pay1"))
$(".goods_num_pay").text(self.attr("goods_num_pay")) $(".goods_num_pay").text(self.attr("goods_num_pay"))
$(".subtotal_pay").text(self.attr("subtotal_pay")) $(".subtotal_pay.ppbox").text(self.attr("subtotal_pay"))
$(".subtotal_pay.ttbox").text(self.attr("subtotal_pay1"))
} }
}) })
}) })
...@@ -129,9 +131,9 @@ define('order', ['tool', 'liexin_pop', 'artTemplate', 'pagination'], function (r ...@@ -129,9 +131,9 @@ define('order', ['tool', 'liexin_pop', 'artTemplate', 'pagination'], function (r
$(this).addClass("act") $(this).addClass("act")
$(".payDetailPop .zftai").hide(); $(".payDetailPop .zftai").hide();
if($(this).attr("guid")==1){ if($(this).attr("guid")==1){
$(".payDetailPop .ppbox").show();
}else{
$(".payDetailPop .ttbox").show(); $(".payDetailPop .ttbox").show();
}else{
$(".payDetailPop .ppbox").show();
} }
}) })
......
...@@ -43,16 +43,16 @@ ...@@ -43,16 +43,16 @@
</div> </div>
<div class="conboxx row"> <div class="conboxx row">
@foreach ($item['children'] as $itemchild) @foreach ($item['children'] as $itemchild)
<a href="/class/{{$itemchild['class_id']}}" class="erji" title="{{$itemchild['class_name_en']}}" target="_blank">{{$itemchild['class_name_en']}}</a> <a href="/class/{{$itemchild['class_id']}}" class="erji" title="{{$itemchild['class_name_en']}}" >{{$itemchild['class_name_en']}}</a>
@endforeach @endforeach
</div> </div>
<div class="rightboxx boxsiz"> <div class="rightboxx boxsiz">
@foreach ($item['children'] as $itemchild) @foreach ($item['children'] as $itemchild)
<div class="grouprightx"> <div class="grouprightx">
<a class="p" title="{{$itemchild['class_name_en']}}" target="_blank" href="/class/{{$itemchild['class_id']}}">{{$itemchild['class_name_en']}}</a> <a class="p" title="{{$itemchild['class_name_en']}}" href="/class/{{$itemchild['class_id']}}">{{$itemchild['class_name_en']}}</a>
<div class="threeClass boxsiz row"> <div class="threeClass boxsiz row">
@foreach ($itemchild['children'] as $itemchild3) @foreach ($itemchild['children'] as $itemchild3)
<a target="_blank" href="/class/{{$itemchild3['class_id']??''}}" title="{{$itemchild3['class_name_en']??''}}">{{$itemchild3['class_name_en']??''}}<span>({{$itemchild3['sku_number']??''}})</span></a> <a href="/class/{{$itemchild3['class_id']??''}}" title="{{$itemchild3['class_name_en']??''}}">{{$itemchild3['class_name_en']??''}}<span>({{$itemchild3['sku_number']??''}})</span></a>
@endforeach @endforeach
</div> </div>
</div> </div>
......
...@@ -115,17 +115,17 @@ ...@@ -115,17 +115,17 @@
Shipping:$<span class="shipping_pay">0.00</span> Shipping:$<span class="shipping_pay">0.00</span>
</div> </div>
<div class="paygroup"> <div class="paygroup">
Payment Surcharge:$<span class="ps_pay">0.00</span> Payment Surcharge:$<span class="ps_pay ttbox zftai" >0.00</span><span class="ps_pay ppbox zftai" style="display:none">0.00</span>
</div> </div>
<div class="paygroup"> <div class="paygroup">
Subtotal ( <span class="goods_num_pay">0</span> item ):$<span class="subtotal_pay">0.00</span> Subtotal ( <span class="goods_num_pay">0</span> item ):$<span class="subtotal_pay ttbox zftai" >0.00</span><span class="subtotal_pay zftai ppbox" style="display:none">0.00</span>
</div> </div>
<div class="ttbox zftai" style="display:none;"> <div class="ttbox zftai" >
<div class="paygroup"> <div class="paygroup">
Paypal Account Number:<span class="paypal"></span> Paypal Account Number:<span class="paypal"></span>
</div> </div>
</div> </div>
<div class="ppbox zftai"> <div class="ppbox zftai" style="display:none;">
<div class="h6">Bank Information</div> <div class="h6">Bank Information</div>
<div class="paygroup"> <div class="paygroup">
Bank Name: <span class="ttl_bank_name"></span> Bank Name: <span class="ttl_bank_name"></span>
...@@ -204,7 +204,7 @@ ...@@ -204,7 +204,7 @@
<div class="btnsi cancelbtn" guid="{{value.order_id}}">Cancel Order</div> <div class="btnsi cancelbtn" guid="{{value.order_id}}">Cancel Order</div>
{{/if}} {{/if}}
{{if (value.status!=1&&value.status!=-1)}} {{if (value.status!=1&&value.status!=-1)}}
<div class="btnsi paybtn" merchandise_pay="{{value.merchandise_total}}" shipping_pay="{{value.shipping}}" ps_pay="{{value.payment_surcharge}}" goods_num_pay="{{value.goods_name_arr.length}}" subtotal_pay="{{value.sub_total}}" >Pay</div> <div class="btnsi paybtn" merchandise_pay="{{value.merchandise_total}}" shipping_pay="{{value.shipping}}" ps_pay1="{{value.payment_surcharge_paypal}}" ps_pay="{{value.payment_surcharge_ttl}}" goods_num_pay="{{value.goods_name_arr.length}}" subtotal_pay1="{{value.sub_total_payal}}" subtotal_pay="{{value.sub_total_ttl}}" >Pay</div>
{{/if}} {{/if}}
......
...@@ -167,8 +167,8 @@ ...@@ -167,8 +167,8 @@
<div class="info-group"> <div class="info-group">
<div class="ht">Shipping Address</div> <div class="ht">Shipping Address</div>
<div class="hcon"> <div class="hcon">
<p>DHL{{shipping_address.shipping_sn}}</p> <p>{{shipping_address.shipping_name}}:{{shipping_address.shipping_sn}}</p>
<p><span>{{shipping_address.shipping_name}}</span> <span class="ml20">{{shipping_address.company_name}}</span></p> <p><span>{{billing_address.consignee}}</span> </p>
<p><span>{{shipping_address.email}}</span> <span class="ml20">{{shipping_address.phone}}</span></p> <p><span>{{shipping_address.email}}</span> <span class="ml20">{{shipping_address.phone}}</span></p>
<p>{{shipping_address.detail_address}}</p> <p>{{shipping_address.detail_address}}</p>
</div> </div>
...@@ -176,8 +176,8 @@ ...@@ -176,8 +176,8 @@
<div class="info-group"> <div class="info-group">
<div class="ht">Billing Address</div> <div class="ht">Billing Address</div>
<div class="hcon"> <div class="hcon">
<p>DHL{{billing_address.shipping_sn}}</p> <p>{{billing_address.shipping_name}}:{{billing_address.shipping_sn}}</p>
<p><span>{{billing_address.shipping_name}}</span> <span class="ml20">{{billing_address.company_name}}</span></p> <p><span>{{billing_address.consignee}}</span> </p>
<p><span>{{billing_address.email}}</span> <span class="ml20">{{billing_address.phone}}</span></p> <p><span>{{billing_address.email}}</span> <span class="ml20">{{billing_address.phone}}</span></p>
<p>{{billing_address.detail_address}}</p> <p>{{billing_address.detail_address}}</p>
</div> </div>
......
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