Commit e3139092 authored by jianghaiming's avatar jianghaiming

update:set

parent 40ae5b42
...@@ -66,15 +66,14 @@ class MarketinggoodsController extends Base ...@@ -66,15 +66,14 @@ class MarketinggoodsController extends Base
$goodsImg = Ksyun::getPicUrl($appid,"goods_temp",$url[0],200,200,'jpeg'); $goodsImg = Ksyun::getPicUrl($appid,"goods_temp",$url[0],200,200,'jpeg');
//$descPicUrlList = array_values($ksyun); //$descPicUrlList = array_values($ksyun);
} }
//$goodsImg = !empty($descPicUrlList[0]) ? $descPicUrlList[0] : '';//商品图片url地址
//$qr_string = "";//二维码扫描后的内容
$url = config('interface','goods.marketing.generate_share_goods'); $url = config('interface','goods.wx.appgc');
if(empty($url)){ if(empty($url)){
throw new InterfaceException(['cus'=>0]); throw new InterfaceException(['cus'=>0]);
} }
$goods_share_url = 'ticket/detail.html?view=1P&fromType=1&goods_sku_id=awPZqLl5KtXQZh6k&goodsShareId='. $goodsShareId;
$goods_share_url = "$url/#/ticket/bpinfo/$goodsSkuId/$userId/$goodsShareId";
$data['goods_share_id'] = $goods_share_url; $data['goods_share_id'] = $goods_share_url;
$data['share_img_url'] = $goodsImg; $data['share_img_url'] = $goodsImg;
$data['share_data'] = [ $data['share_data'] = [
......
...@@ -14,6 +14,7 @@ use App\Exception\custom\ShopException; ...@@ -14,6 +14,7 @@ use App\Exception\custom\ShopException;
use Api\PhpServices\Sensitive\Sensitive; use Api\PhpServices\Sensitive\Sensitive;
use App\Exception\custom\InterfaceException; use App\Exception\custom\InterfaceException;
use Api\PhpUtils\Http\Request; use Api\PhpUtils\Http\Request;
use Helpers\Aes;
class CommonService class CommonService
{ {
...@@ -41,5 +42,19 @@ class CommonService ...@@ -41,5 +42,19 @@ class CommonService
} }
return []; return [];
} }
/**
* 获取分享码code
*
*/
public static function getGoodsShareId($params)
{
$userId = !empty($params['user_id']) ? $params['user_id'] : 0;
$marketingId = !empty($params['marketing_id']) ? $params['marketing_id'] : 0;
$goodsSkuId = !empty($params['goods_sku_id']) ? $params['goods_sku_id'] : 0;
$content = $userId .'_' .$marketingId . '_' .$goodsSkuId;
$goodsShareId = Aes::encrypt($content);
return $goodsShareId;
}
} }
\ No newline at end of file
...@@ -386,7 +386,7 @@ class DistributorService ...@@ -386,7 +386,7 @@ class DistributorService
if(empty($url)){ if(empty($url)){
throw new InterfaceException(['cus'=>0]); throw new InterfaceException(['cus'=>0]);
} }
$codeUrl = $url.'/#/ticket/commander/'.$params['user_id'].'/-'; $codeUrl = $url.'/#/ticket/commander/?share_user_id='.$params['user_id'];
$distributorCodeUrl = (new GetImage())->getLeaderShare($codeUrl); $distributorCodeUrl = (new GetImage())->getLeaderShare($codeUrl);
} }
......
...@@ -70,7 +70,11 @@ class MarketingGoodsService ...@@ -70,7 +70,11 @@ class MarketingGoodsService
$marketingId = array_column($marketingList, 'marketing_id'); $marketingId = array_column($marketingList, 'marketing_id');
$where['marketing_id'] = !empty($marketingId) ? $marketingId : []; $where['marketing_id'] = !empty($marketingId) ? $marketingId : [];
$data = MarketingGoods::marketingGoodsList($where); $data = MarketingGoods::marketingGoodsList($where);
$goodsSkuId = array_column($data, 'goods_sku_id'); $goodsSkuId = [];
if (!empty($data)) {
$goodsSkuId = array_column($data, 'goods_sku_id');
}
$goodsSkuList = GoodsSku::getRecordMaster(['goods_sku_id' => $goodsSkuId]); $goodsSkuList = GoodsSku::getRecordMaster(['goods_sku_id' => $goodsSkuId]);
$goodsSkuList = array_column($goodsSkuList,null,'goods_sku_id'); $goodsSkuList = array_column($goodsSkuList,null,'goods_sku_id');
$lastData = end($data); $lastData = end($data);
......
...@@ -103,6 +103,10 @@ class ShopService ...@@ -103,6 +103,10 @@ class ShopService
$where['sub_shop_id'] = $subShopId; $where['sub_shop_id'] = $subShopId;
} }
if (!empty($shopId)) {
$where['shop_id'] = $shopId;
}
if (!empty($lifeAccountId)) { if (!empty($lifeAccountId)) {
$where['life_account_id'] = $lifeAccountId; $where['life_account_id'] = $lifeAccountId;
} }
......
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 to comment