Commit 16fd48a8 by 杨树贤

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

parents 9e10b365 6e25b493
......@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
use App\Http\ApiHelper\ApiCode;
use App\Http\Requests\UserRegister;
use App\Http\Services\CartService;
use App\Http\Services\InquiryService;
......@@ -41,8 +42,8 @@ class OrderApiController extends Controller
'shipping_address_id',
]);
$result = OrderService::addOrder($data, $request->user->id);
return !$result ? $this->setError('Add order failed , please contact administrator'):$this->setSuccess('Add order success');
$order_id = OrderService::addOrder($data, $request->user->id);
return !$order_id ? $this->setError('Add order failed , please contact administrator'):$this->setSuccessData($order_id,0,ApiCode::API_CODE_SUCCESS,'Add order success');
}
//订单列表
......
......@@ -75,6 +75,10 @@ class OrderService
#订单地址
$shippingAddress = UserAddressModel::where("address_id",$shipping_address_id)->first();
$billingAddress = UserAddressModel::where("address_id",$billing_address_id)->first();
if (!$shippingAddress || !$billingAddress){
throw new InvalidRequestException("error: Address");
}
$addressData =[[
"address_id"=>$shipping_address_id,
"user_id"=>$user_id,
......@@ -94,7 +98,7 @@ class OrderService
"create_time"=>time(),
"update_time"=>time(),
],[
"address_id"=>$shipping_address_id,
"address_id"=>$billing_address_id,
"user_id"=>$user_id,
"order_id"=>$order_id,
"address_type"=>\Arr::get($billingAddress,"address_type",0),
......@@ -127,11 +131,26 @@ class OrderService
$goods_id = $v['goods_id'];
$skuInfo = $goodsInfoArr[$goods_id]; //sku详情
$cartInfo = CartModel::where(["user_id"=>$user_id,"goods_id"=>(string)$goods_id,"status"=>1])->first();
$buy_number = $v["buy_number"];
$buy_price = $v["buy_price"];
$orderAmount += round($buy_number*$buy_price,2);
$standard_brand = data_get($skuInfo,"standard_brand");
#查询英文品牌缩写
$brandName = $skuInfo["brand_name"];
$standard_brand_id = \Arr::get($standard_brand,"standard_brand_id",0);
$standardBrandInfo = $redis->hget("standard_brand",$standard_brand_id);
if ($standardBrandInfo){
$standardBrandInfoArr = json_decode($standardBrandInfo,true);
#深贸商城的品牌字段需展示该SKU对应基石标准品牌列表的英文简称,无则取英文名称、都无则取品牌名称
if ($standardBrandInfoArr["brand_short_name_en"]){
$brandName = $standardBrandInfoArr["brand_short_name_en"];
}else if ($standardBrandInfoArr["brand_name_en"]){
$brandName = $standardBrandInfoArr["brand_name_en"];
}
}
//订单明细
$orderItems[] = [
"order_id"=>$order_id, //订单ID
......@@ -139,17 +158,17 @@ class OrderService
"goods_id"=>$goods_id, //商品ID
"supplier_id"=>\Arr::get($skuInfo,"supplier_id",0), //供应商ID(=company_id)
"brand_id"=>$skuInfo["brand_id"], //品牌ID
"standard_brand_id"=>\Arr::get($standard_brand,"standard_brand_id",0), //标准品牌ID
"standard_brand_id"=>$standard_brand_id, //标准品牌ID
"goods_name"=>\Arr::get($skuInfo,"goods_name",0), //型号
"class_id2"=>\Arr::get($skuInfo,"class_id2",0), //商品二级分类id
"batch"=>\Arr::get($skuInfo,"batch_sn",0), //批次
"class_id2_name"=>"", //商品二级分类名称
"supplier_name"=>\Arr::get($skuInfo,"supplier_name",0), //供应商名(=company_name)
"brand_name"=>\Arr::get($skuInfo,"brand_name",0), //品牌名
"brand_name"=>$brandName, //品牌名
"standard_brand_name"=>\Arr::get($standard_brand,"brand_name",""), //标准品牌
"goods_type"=>2, //商品类型 联营:1专卖 2联营 自营 :3自营 4寄售 5第三方仓库
"goods_number"=>$buy_number, //购买数量
"goods_price"=>\Arr::get($skuInfo,"buy_price",0), //商品单价
"goods_price"=>$buy_price, //商品单价
"goods_unit"=>"pcs", //商品单位
"delivery_time"=>\Arr::get($skuInfo,"hk_delivery_time",""), //交货时间
"canal"=>\Arr::get($skuInfo,"canal",""), //渠道标签
......@@ -166,14 +185,15 @@ class OrderService
"remarks"=>$v["remark"], //客户备注
];
#扣减购物车库存
$temp["status"] = $v["buy_number"] > 0 ? CartModel::status_yes:CartModel::status_no;
$temp["create_time"] = time();
$temp["update_time"] = time();
$cartUpdate = CartModel::where("cart_id",$cartInfo["cart_id"])->update($temp);
if (!$cartUpdate){
throw new InvalidRequestException("error:update cart");
if ($cartInfo){
#扣减购物车库存
$temp["status"] = $v["buy_number"] > 0 ? CartModel::status_yes:CartModel::status_no;
$temp["create_time"] = time();
$temp["update_time"] = time();
$cartUpdate = CartModel::where("cart_id",$cartInfo["cart_id"])->update($temp);
if (!$cartUpdate){
throw new InvalidRequestException("error:update cart");
}
}
}
......@@ -203,10 +223,10 @@ class OrderService
$con->commit();
return true;
return $order_id;
}catch (\Exception $e){
$con->rollback();
throw new InvalidRequestException($e->getMessage().$e->getFile().$e->getLine());
throw new InvalidRequestException($e->getMessage());
}
}
......@@ -299,7 +319,7 @@ class OrderService
"shipping"=>\Arr::get($priceArr,3,0), //运费
"payment_surcharge"=>\Arr::get($priceArr,5,0), //支付手续费
"merchandise_total"=>$merchandise_total, //商品总额
"sub_total"=>$v["order_amount"], //小计
"sub_total"=>OrderPriceModel::getOrderSubTotal($order_id), //小计
"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):"", //截止时间
];
......@@ -398,7 +418,7 @@ class OrderService
"order_id"=>$order_id,
"order_sn"=>$orderInfo["order_sn"],
"order_amount"=>$orderInfo["order_amount"],
"sub_total"=>$orderInfo["order_amount"], //小计
"sub_total"=>OrderPriceModel::getOrderSubTotal($order_id), //小计
"created_time"=>timeToDate($orderInfo["create_time"]), //创建时间
"reviewed_time"=>timeToDate($orderInfo["confirm_time"]), //审核时间
"paid_time"=>timeToDate($orderInfo["pay_time"]), //支付时间
......
......@@ -17,5 +17,12 @@ class OrderPriceModel extends Model
return ($res) ? $res->toArray() : [];
}
//计算订单总金额
public static function getOrderSubTotal($order_id)
{
return self::where("order_id",$order_id)->wherein("price_type",[1,3,5])->sum("price");
}
}
......@@ -82,9 +82,14 @@ body{background: #000;min-width: 1200px;}
margin-bottom: 1px;
&.trr{padding-left: 122px;}
&.trl{text-align: right;padding-right: 122px;margin-right: 1px;}
span{transition: all 0.6s;}
&:hover{ background: url("../../images/home/subj.png") no-repeat;background-size: 100% 100%;
font-size: 30px;
span{opacity: 0;}
}
&.bgrp1:hover{ background: url("../../images/about/bgrp1.png") no-repeat;background-size: 100% 100%;}
&.bgrp2:hover{ background: url("../../images/about/bgrp2.png") no-repeat;background-size: 100% 100%;}
&.bgrp3:hover{ background: url("../../images/about/bgrp3.png") no-repeat;background-size: 100% 100%;}
&.bgrp4:hover{ background: url("../../images/about/bgrp4.png") no-repeat;background-size: 100% 100%;}
}
}
.readbox{
......
No preview for this file type
No preview for this file type
This diff could not be displayed because it is too large.
......@@ -192,6 +192,7 @@ define('confirm', ['liexin_pop','form','artTemplate'], function (require, export
liexin_pop.Tip({ title: res.msg })
ele.fadeOut(300)
$(".address-group.ship").attr("guid","").find(".xrdata").html("")
$(".address-group.bill").attr("guid","").find(".xrdata").html("")
$(".editboxcs").hide();
} else {
liexin_pop.Tip({ title: res.msg })
......
......@@ -14,36 +14,36 @@
</div>
<div class="floor2">
<div class="jscon boxsiz">
<p><b>A</b>s a company with rich experience in this industry, Semour Electronics has been recognized by the major organizations, Semour will continue to optimize and improve our professional service teams ,accel-erate digital service capabilities aim to strengthen the whole supply chain globally. Along this target above, Semour will keep offering wide ranges of electronic supply chain solutions for customers world wide.</p>
<p><b>A</b>s a company with rich experience in this industry, Semour Electronics has been recognized by the major organizations, Semour will continue to optimize and improve our professional service teams, accelerate digital service capabilities aim to strengthen the whole supply chain globally. Along this target above, Semour will keep offering wide ranges of electronic supply chain solutions for customers worldwide.</p>
</div>
<div class="floor3">
<div class="fl3con row rowCenter">
<div class="item item1 boxsiz">
<a class="item item1 boxsiz" href="{{$public}}/assets/images/home/D&B.pdf" target="_blank">
<p>D-U-N-S® Number</p>
<div class="column verCenter rowCenter imgbox">
<img src="{{$public}}/assets/images/about/st1.png" class="st" alt="">
<img src="{{$public}}/assets/images/about/ht1.png" class="ht" alt="">
</div>
<div class="text"><i class="icon iconfont icon-lansejiantou ijt"></i></div>
</div>
<div class="item item1 boxsiz itemlast">
</a>
<a class="item item1 boxsiz itemlast" href="{{$public}}/assets/images/home/ERAI.pdf" target="_blank">
<p>ERAI Membership</p>
<div class="column verCenter rowCenter imgbox">
<img src="{{$public}}/assets/images/about/app1.png" class="st" alt="">
<img src="{{$public}}/assets/images/about/app2.png" class="ht" alt="">
</div>
<div class="text"><i class="icon iconfont icon-lansejiantou ijt"></i></div>
</div>
<div class="item item1 boxsiz itemlast">
</a>
<a class="item item1 boxsiz itemlast" href="{{$public}}/assets/images/home/ISO9001.pdf" target="_blank">
<p>ISO9001:2015</p>
<div class="column verCenter rowCenter imgbox">
<img src="{{$public}}/assets/images/about/ht2.png" class="st" alt="">
<img src="{{$public}}/assets/images/about/st2.png" class="ht" alt="">
</div>
<div class="text"><i class="icon iconfont icon-lansejiantou ijt"></i></div>
</div>
</a>
</div>
</div>
<div class="readbox">
......@@ -54,7 +54,7 @@
</div>
</div>
</div>
@include('common.footersm')
</div>
......
......@@ -14,13 +14,13 @@
</div>
<div class="floor2">
<div class="jscon boxsiz">
<p><b>S</b>emour Electronics Co., LTD , located in Hong Kong, is one of the subsidiaries of Shenzhen ICHUNT Technology Co., LTD. As a global electronic supply chain solution provider ,Semour is committed to many EMS/OEM/ODM manufacturer clients with the comprehensive real-time stock goods and supporting services .
<p><b>S</b>emour Electronics Co., LTD, located in Hong Kong, is one of the subsidiaries of Shenzhen ICHUNT Technology Co., LTD. As a global electronic supply chain solution provider, Semour is committed to many EMS/OEM/ODM manufacturer clients with the comprehensive real-time stock goods and supporting services.
</p>
<p><b>W</b> ith rich industry experience, Semour Electronics provides customer-oriented one-stop electronic component services, including spot and related financial, warehousing and logistics services. So far, Semour online store has brought more than 1,000 categories of inventory to nearly 1,000 suppliers around the world. The online store allows customers to search for inventory and prices in real time and enjoy the one-on-one service of our professional sales team.
<p><b>W</b>ith rich industry experience, Semour Electronics provides customer-oriented one-stop electronic component services, including spot and related financial, warehousing and logistics services. So far, Semour online store has brought more than 1,000 categories of inventory to nearly 1,000 suppliers around the world. The online store allows customers to search for inventory and prices in real time and enjoy the one-on-one service of our professional sales team.
</p>
<p><b>T</b>hrough Semour Quality Testing Center, Semour Electronics can prevent counterfeit components from entering your supply chain. Our well-established supply chain system can respond to any customer inquiry and meet the diverse market environment. Semour Electronics' goal is to increase the productivity of electronic trading services and to continuously bring intervention and innovation to the industry.
<p><b>T</b>hrough Semour Quality Inspection Center, Semour Electronics can prevent counterfeit components from entering your supply chain. Our well-established supply chain system can respond to any customer inquiry and meet the diverse market environment. Semour Electronics' goal is to increase the productivity of electronic trading services and to continuously bring intervention and innovation to the industry.
</p>
<p><b>T</b>he parent company of Semour Electronics is Shenzhen ICHUNT Technology Company Limited which headquarter located in Shenzhen, China. The company currently has more than 400 employees and the business network of ICHUNT Technology has covered most of the major cities of China including Hong Kong, Beijing, Shanghai, Suzhou, Nanjing, Hefei, Wuhan, Dalian, Qingdao. These subsidiaries and office branches can rapidly respond to the various requirement from the enterprise customers in the electronic industry within the coverage area. Currently ICHUNT Technology has obtained several rounds of financial investment from well-known venture capital, including Matrix Partners China, Welight Capital, Hua Partners, JD. Capital, Haitong Securities.
<p><b>T</b>he parent company of Semour Electronics is Shenzhen ICHUNT Technology CO., LTD, which headquarter located in Shenzhen, China. The company currently has more than 430 employees and the business network has covered most of the major cities of China including Hong Kong, Beijing, Shanghai, Suzhou, Nanjing, Hefei, Wuhan, Dalian, Qingdao. These branches can rapidly respond to the various requirements from the customers worldwide. Now ICHUNT has obtained several rounds of financial investment from well-known venture capital, including Matrix Partners China, Welight Capital, Hua Partners, JD. Capital, Haitong Securities.
</p>
</div>
<div class="readbox">
......
......@@ -14,17 +14,17 @@
</div>
<div class="floor2">
<div class="jscon boxsiz">
<p><b>S</b>emour Electronics has a strict and complete quality control management system. Each component sold out from Semour has passed the internal quality inspection (IQC) and been eliminated any potential risks for subsequent use by customers. As an important segment supply chain for customers, Semour conducts the check-up strictly for every upstream supplier to prevent any counterfeit products enter into Semour's supply chain. Semour is committed to provide customers below :
<p><b>S</b>emour Electronics has a strict and complete quality control management system. Each component sold out from Semour has passed the internal quality inspection (IQC) and been eliminated any potential risks for subsequent use by customers. As an important segment supply chain for customers, Semour conducts the check-up strictly for every upstream supplier to prevent any counterfeit products enter into Semour's supply chain. Semour is committed to provide customers below:
</p>
</div>
<div class="supplierboxsp">
<div class="row">
<div class="itemf3 trl">Supply Chain Management</div>
<div class="itemf3 trr">Quality Inspection on Each Part</div>
<div class="itemf3 trl bgrp1"><span>Supply Chain Management</span></div>
<div class="itemf3 trr bgrp2"><span>Quality Inspection on Each Part</span></div>
</div>
<div class="row">
<div class="itemf3 trl">Professional Engineering Team</div>
<div class="itemf3 trr">Value-added Service</div>
<div class="itemf3 trl bgrp3"><span>Professional Engineering Team</span></div>
<div class="itemf3 trr bgrp4"><span>Value-added Service</span></div>
</div>
</div>
<div class="readbox">
......
......@@ -11,7 +11,7 @@
@endif
</a>
</div>
<a href="/about/company" class="about-link">Contact Us</a>
<a href="javascript:void(0)" class="about-link gofooter">Contact Us</a>
</div>
</div>
......
......@@ -200,9 +200,10 @@
<div class="td w239">{{value.shipping_address}}</div>
<div class="td w150">
<!-- <div class="btnsi">Buy Again</div> -->
{{if (value.status==1||value.status==-1)}}
{{if (value.status==1)}}
<div class="btnsi cancelbtn" guid="{{value.order_id}}">Cancel Order</div>
{{else}}
{{/if}}
{{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>
{{/if}}
......
......@@ -187,7 +187,7 @@
<div class="ht">Settlement Information</div>
<div class="hcon">
<p>Merchandise Total:${{merchandise_total}} <span class="ml20">Shipping:${{shipping}} </span> <span class="ml20">Payment Surcharge:${{payment_surcharge}}</span></p>
<p>Subtotal(3item):${{sub_total}}</p>
<p>Subtotal({{items.length}}item):${{sub_total}}</p>
</div>
</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