Commit c1ade109 by 孙龙

up

parent 11556af5
...@@ -427,7 +427,7 @@ class BomService { ...@@ -427,7 +427,7 @@ class BomService {
$err_msg = []; $err_msg = [];
$data = $request->input("data",''); $data = $request->input("data",'');
$bom_id = $data[0]["bom_id"]; $bom_id = $data[0]["bom_id"];
$bom = BomModel::where(["bom_id"=>intval($bom_id)])->select("user_id","where")->first(); $bom = BomModel::where(["bom_id"=>intval($bom_id)])->select("user_id","where","bom_sn")->first();
$user_id = $bom->user_id; $user_id = $bom->user_id;
$bom_where = $bom->where; $bom_where = $bom->where;
$delivery_type = 0;//交货地 $delivery_type = 0;//交货地
...@@ -447,6 +447,7 @@ class BomService { ...@@ -447,6 +447,7 @@ class BomService {
$extend["delivery_type"] = $delivery_type; $extend["delivery_type"] = $delivery_type;
$extend["currency"] = $currency; $extend["currency"] = $currency;
$extend["bom_id"] = $bom_id; $extend["bom_id"] = $bom_id;
$extend["bom_sn"] = $bom->bom_sn;
$address_id = $this->getAddress($user_id); $address_id = $this->getAddress($user_id);
$extend["address_id"] = $address_id; $extend["address_id"] = $address_id;
$ziying = []; $ziying = [];
...@@ -472,6 +473,7 @@ class BomService { ...@@ -472,6 +473,7 @@ class BomService {
$lianying[$k]["delivery_time"] = $item['match_delivery']; $lianying[$k]["delivery_time"] = $item['match_delivery'];
$lianying[$k]["supplier_name"] =$item['match_supplier_name']; $lianying[$k]["supplier_name"] =$item['match_supplier_name'];
$lianying[$k]["id"] = $item['match_goods_id']; $lianying[$k]["id"] = $item['match_goods_id'];
$ziying[$k]["matching_id"] = $item["matching_id"];
} }
} }
...@@ -497,6 +499,7 @@ class BomService { ...@@ -497,6 +499,7 @@ class BomService {
protected function lyOrder($user_id,$lianying,$extend,&$err_msg){ protected function lyOrder($user_id,$lianying,$extend,&$err_msg){
//创建购物车 //创建购物车
$lyShopCart = $this->createLYOrderToShopCart($user_id,$lianying,$extend,$err_msg); $lyShopCart = $this->createLYOrderToShopCart($user_id,$lianying,$extend,$err_msg);
// exit;
if(!empty($lyShopCart) && $lyShopCart['err_code'] == 0){//加入购物车成功 if(!empty($lyShopCart) && $lyShopCart['err_code'] == 0){//加入购物车成功
//获取联营购物车 //获取联营购物车
$car_ids = $this->getShopCart($user_id,1); $car_ids = $this->getShopCart($user_id,1);
...@@ -529,7 +532,7 @@ class BomService { ...@@ -529,7 +532,7 @@ class BomService {
*/ */
protected function createLYOrderToShopCart($user_id,$lianying,$extend){ protected function createLYOrderToShopCart($user_id,$lianying,$extend){
$url = Config('website.addlyorder_url'); $url = Config('website.addlyorder_url');
$data['bom_id'] = $extend["bom_id"]; $data["bom_sn"] = $extend["bom_sn"];
$data['uid'] = intval($user_id) ? intval($user_id) : 0; $data['uid'] = intval($user_id) ? intval($user_id) : 0;
$data["type"] = 2;//1-前台,2-后台,3-后台批量添加 $data["type"] = 2;//1-前台,2-后台,3-后台批量添加
$data['delivery_place'] = $extend["delivery_type"]; $data['delivery_place'] = $extend["delivery_type"];
...@@ -549,6 +552,7 @@ class BomService { ...@@ -549,6 +552,7 @@ class BomService {
protected function zyOrder($user_id,$ziying,$extend,&$err_msg){ protected function zyOrder($user_id,$ziying,$extend,&$err_msg){
//请求 api接口 加入购物车 //请求 api接口 加入购物车
$addZYShopCart = $this->createZYOrderToShopCart($user_id,$ziying,$extend); $addZYShopCart = $this->createZYOrderToShopCart($user_id,$ziying,$extend);
// exit;
if(!empty($addZYShopCart) && $addZYShopCart['err_code'] == 0){//加入购物车成功 if(!empty($addZYShopCart) && $addZYShopCart['err_code'] == 0){//加入购物车成功
//获取自营购物车 //获取自营购物车
$car_ids = $this->getShopCart($user_id,3); $car_ids = $this->getShopCart($user_id,3);
...@@ -586,6 +590,7 @@ class BomService { ...@@ -586,6 +590,7 @@ class BomService {
$data['address_id'] = $extend["address_id"]; $data['address_id'] = $extend["address_id"];
$data['k1'] = time(); $data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi'); $data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
// dump(curlApi($url, $data, 'POST'));exit;
$response = json_decode(curlApi($url, $data, 'POST'), true); $response = json_decode(curlApi($url, $data, 'POST'), true);
return $response; return $response;
} }
...@@ -616,6 +621,7 @@ class BomService { ...@@ -616,6 +621,7 @@ class BomService {
$url = Config('website.addzyorder_url'); $url = Config('website.addzyorder_url');
$data['type'] = 2;//后台加入购物车 $data['type'] = 2;//后台加入购物车
$data['delivery_place'] = $extend['delivery_type']; $data['delivery_place'] = $extend['delivery_type'];
$data["bom_sn"] = $extend["bom_sn"];
$data["data"] = array_merge($ziying); $data["data"] = array_merge($ziying);
$data['uid'] = intval($user_id) ? intval($user_id) : 0; $data['uid'] = intval($user_id) ? intval($user_id) : 0;
$data['k1'] = time(); $data['k1'] = time();
......
...@@ -60,13 +60,13 @@ return [ ...@@ -60,13 +60,13 @@ return [
'search-skuid-finalInfo' => 'http://api.liexin.com/cart/bomOrderGetFinalGoods', 'search-skuid-finalInfo' => 'http://api.liexin.com/cart/bomOrderGetFinalGoods',
//批量下自营订单 //自营订单添加购物车
'addzyorder_url' => 'http://api.liexin.com/cart/addBatch', 'addzyorder_url' => 'http://api.liexin.com/cart/addBatch',
//联营 //联营加入购物车
'addlyorder_url' => 'http://api.liexin.com/cart/addBatchByOrderSystem', 'addlyorder_url' => 'http://api.liexin.com/cart/addBatchByOrderSystem',
//创建订单 //bom创建订单
'api_create_order' => 'http://api.liexin.com/order/create', 'api_create_order' => 'http://api.liexin.com/order/create',
// 新增SKU入口 // 新增SKU入口
......
...@@ -76,6 +76,7 @@ layui.use(['form', 'table', 'laydate'], function() { ...@@ -76,6 +76,7 @@ layui.use(['form', 'table', 'laydate'], function() {
console.log(err) console.log(err)
} }
}) })
layer.msg('请耐心等待....', {icon: 16, time: 5000, shade: 0.3})
return false; return false;
}, },
cancel: function(index) { cancel: function(index) {
...@@ -109,6 +110,7 @@ layui.use(['form', 'table', 'laydate'], function() { ...@@ -109,6 +110,7 @@ layui.use(['form', 'table', 'laydate'], function() {
console.log(err) console.log(err)
} }
}) })
layer.msg('请耐心等待....', {icon: 16, time: 10000, shade: 0.3})
return false; return false;
}, },
cancel: function(index) { cancel: function(index) {
......
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