/**
* @title 获取预览或发布的蜂店模板样式
* @param store_id 是 string 店铺id
* @param type 是 int 装修模板的状态:1-预览蜂店装修模板样式、2-正式发布的蜂店装修模板样式
* @param type_id 是 int 要装修商品的类型(1-平台、2-特色)
* @example FlagShipShopDecorate.getShopDecorateStyleOne? 调试参数:{"username":"17721355485","check_code":"123456","method":"FlagShipShopDecorate.getShopDecorateStyleOne","type":"1","store_id":"115066910197999","type_id":"1"}
* @return_param_explain list_status:次数(1为首次进入/2为再次进入) shop_decorate_method:店铺装修秘籍 store_info-- store_version:1-蜂雷云店标准版/2-专业版/3-蜂雷云店--基础版/4-蜂雷云店--标准版/5-蜂雷云店--高级版/6-蜂雷云店--专业版 store_name:店铺名称 store_desc:店铺简介 bgpath:店铺背景图 short_number:短编号 logopath:用户头像 plate_id:店铺装修样式ID type:模板样式子板块类型(4-海景、6-二宫格、8-三宫格、9-四宫格) isShow:是否显示名称价格信息(1是、2否) sort:模块排序位置 index:商品sku排序位置 sku_id:商品属性ID search_name:商品搜索名称 short_name:商品短名称 sku_no:商品sku编号 title:商品sku名称 imgs:海景图 img:商品sku图片 sell_price:售价 sell_nums:销量 operate_type:1-显示商品、2-不显示商品 activity_info--- activityId:活动编码 activityType:活动类型 productPrice:活动售价 costPrice:成本价 title:活动标题 isAct:是否是活动(true:是、false:不是) show_status:0-既不显示特色也不显示平台、1-只显示特色、2-只显示平台、3-即显示特色也显示平台
* @method POST
* @author 邹柯
*/
public function getShopDecorateStyleOne($res){
$user_id=session('user.user_id');
$type=$res['type'];
if($type != && $type !=){
E('');
}
$type_id=$res['type_id'];
if($type_id != && $type_id !=){
E('');
}
$store_id=$res['store_id']; $user_shop_decorate=M('user_shop_decorate');
$usd_where['flagship_shop']=;
$usd_where['create_id']=$user_id;
if($type_id ==){
$usd_info=$user_shop_decorate->field('plate_id')->where($usd_where)->find();
}else{
$usd_info=$user_shop_decorate->field('plate_id_features plate_id')->where($usd_where)->find();
} if(empty($usd_info)){
$plate_id=;
}else{
$plate_id=$usd_info['plate_id'];
}
        if(empty($usd_info)){
$plate_id=1;
$plate_content=$this->getShopDecorateInfoNew($plate_id,$store_id,$type_id);
}else{
$plate_id=$usd_info['plate_id'];
if(empty($plate_id)){
$plate_id=1;
$plate_content=$this->getShopDecorateInfoNew($plate_id,$store_id,$type_id);
}else{
$plate_content=$this->getShopDecorateInfo($plate_id,$type,$store_id,$type_id);
}
}
        //组装店铺信息 
$plate_content['store_info']=$this->getStoreInfoByStoreId($store_id);
$shop_decorate_read=M('shop_decorate_read');
$cn=$shop_decorate_read->where(['user_id'=>$user_id])->count();
if($cn==){
$shop_decorate_read->data(['user_id'=>$user_id])->add();
$plate_content['list_status']=;
}else{
$plate_content['list_status']=;
}
$plate_content['shop_decorate_method']=$this->getShopDecorateMethod();
$plate_content['show_status']=$this->isHasTeseGoods($user_id,);
        if($list_status['list_status']==1){
$show_status=3;
}else{
$show_status=2;
} $plate_content['show_status']=$show_status;
return $plate_content;
}

返回结果

{
"status":"",
"errorCode":"",
"msg":"成功",
"result":{
"plate_id":"",
"list":[
{
"type":,
"isShow":"",
"sort":,
"goods":[
{
"sku_id":"",
"operate_type":,
"index":,
"type":,
"product_num":"",
"search_name":"无线路由器wifi穿墙 信号放大 覆盖范围广",
"short_name":"斐讯K2",
"sku_no":"P001219-01",
"title":"斐讯(PHICOMM)K2 1200M智能双频无线路由器 ",
"img":"http://img.test.feelee.cc//Public/Uploads/goodsimg/I0/5aa8d44648d05.jpg",
"sell_price":"399.00",
"activity_info":{
"productId":"P001219",
"skuNo":"P001219-01",
"productPrice":"00.00",
"costPrice":"00.00",
"activityId":null,
"activityType":null,
"title":null,
"status":"",
"isAct":false
},
"store_id":"",
"sell_nums":"",
"imgs":[
"http://img.test.feelee.cc/Public/Uploads/img/I9/P001219/P001219-xyqsNNNDrC.jpg",
"http://img.test.feelee.cc/Public/Uploads/img/I5/P002975/P002975-65BSz8DPmY.jpg",
"http://img.test.feelee.cc/Public/Uploads/img/I5/P002975/P002975-409oFe6y5R.jpg",
"http://img.test.feelee.cc/Public/Uploads/img/I9/P001219/P001219-JsN1EpDf5p.jpg",
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I9/5a1e81afa85f2.jpg"
]
}
]
},
{
"type":,
"isShow":"",
"sort":,
"goods":[
{
"sku_id":"",
"operate_type":,
"index":,
"type":,
"product_num":"",
"search_name":"预售 2018年3月31日前统一发货 全渠道首批发货",
"short_name":"NAS",
"sku_no":"P002026-01",
"title":"【预售】斐讯(PHICOMM)天天链N1 新一代家庭专业NAS云盘 珍珠白",
"img":"http://img.test.feelee.cc//Public/Uploads/goodsimg/I3/5a6af2a558fc5.jpg",
"sell_price":"1499.00",
"activity_info":{
"productId":"P002026",
"skuNo":"P002026-01",
"productPrice":"00.00",
"costPrice":"00.00",
"activityId":null,
"activityType":null,
"title":null,
"status":"",
"isAct":false
},
"store_id":"",
"sell_nums":"",
"imgs":[
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I0/5a6af1d051e53.jpg",
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I2/5a6af1d2349ff.jpg",
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I4/5a6af1d496d26.jpg",
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I7/5a6af1d7ccae3.jpg"
]
}
]
},
{
"type":,
"isShow":"",
"sort":,
"goods":[
{
"sku_id":"",
"operate_type":,
"index":,
"type":,
"product_num":"",
"search_name":"1TB存储容量 轻薄机身 type-c接口 USB3.0协议 高速传输",
"short_name":"斐讯H1",
"sku_no":"P002330-01",
"title":"斐讯(PHICOMM) H1 移动硬盘 ",
"img":"http://img.test.feelee.cc//Public/Uploads/server/goods/20180411/a68db15234153762907.jpg",
"sell_price":"999.00",
"activity_info":{
"productId":"P002330",
"skuNo":"P002330-01",
"productPrice":"00.00",
"costPrice":"00.00",
"activityId":null,
"activityType":null,
"title":null,
"status":"",
"isAct":false
},
"store_id":"",
"sell_nums":"",
"imgs":[
"http://img.test.feelee.cc/Public/Uploads/server/goods/20180428/d0e8c15248997668431.png",
"http://img.test.feelee.cc/Public/Uploads/server/goods/20180411/5459d15234153678189.jpg",
"http://img.test.feelee.cc/Public/Uploads/server/goods/20180411/02b5c15234153694863.jpg",
"http://img.test.feelee.cc/Public/Uploads/server/goods/20180411/b86ce15234153713606.jpg",
"http://img.test.feelee.cc/Public/Uploads/server/goods/20180411/86d0815234153734114.jpg"
]
}
]
},
{
"type":,
"isShow":"",
"sort":,
"goods":[
{
"sku_id":"",
"operate_type":,
"index":,
"type":,
"product_num":"",
"search_name":"深入清洁牙齿缝隙和牙线 有效缓解牙齿敏感",
"short_name":"多效防敏小苏打牙膏",
"sku_no":"P002023-01",
"title":"艾禾美 多效防敏小苏打牙膏 127g",
"img":"http://img.test.feelee.cc//Public/Uploads/goodsimg/I1/5a6e8b4d0d69d.jpg",
"sell_price":"10.00",
"activity_info":{
"productId":"P002023",
"skuNo":"P002023-01",
"productPrice":"00.00",
"costPrice":"00.00",
"activityId":null,
"activityType":null,
"title":null,
"status":"",
"isAct":false
},
"store_id":"",
"sell_nums":"",
"imgs":[
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I4/5a6e8b3cb5a1e.jpg",
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I2/5a6e8b3a55b85.jpg",
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I0/5a6e8b42498da.jpg",
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I2/5a6e8b4415a01.jpg",
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I4/5a6e8b4606e52.jpg"
]
},
{
"sku_id":"",
"operate_type":,
"index":,
"type":,
"product_num":"",
"search_name":" CADR值=350立方米每小时 节能静音",
"short_name":"PHICOMM/斐讯 悟净A1空气净化器",
"sku_no":"P001788-01",
"title":"斐讯(PHICOMM) 悟净A1空气净化器 智能操控 除甲醛PM2.5有害气体 ",
"img":"http://img.test.feelee.cc//Public/Uploads/goodsimg/I5/5a4447016c6bd.jpg",
"sell_price":"1999.00",
"activity_info":{
"productId":"P001788",
"skuNo":"P001788-01",
"productPrice":"00.00",
"costPrice":"00.00",
"activityId":null,
"activityType":null,
"title":null,
"status":"",
"isAct":false
},
"store_id":"",
"sell_nums":"",
"imgs":[
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I5/5a44466b3470f.jpg",
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I0/5a444670dc152.jpg",
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I4/5a4446748a00c.jpg",
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I8/5a4446789d516.jpg",
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I2/5a44467c4b1c4.jpg"
]
},
{
"sku_id":"",
"operate_type":,
"index":,
"type":,
"product_num":"",
"search_name":"双星定位 IP67防水防尘 心率监测 睡眠监测",
"short_name":"斐讯智能运动手环 W1",
"sku_no":"P002080-01",
"title":"斐讯(PHICOMM)智能运动手环 W1",
"img":"http://img.test.feelee.cc//Public/Uploads/goodsimg/I2/5a935cc6726b8.jpg",
"sell_price":"799.00",
"activity_info":{
"productId":"P002080",
"skuNo":"P002080-01",
"productPrice":"00.00",
"costPrice":"00.00",
"activityId":null,
"activityType":null,
"title":null,
"status":"",
"isAct":false
},
"store_id":"",
"sell_nums":"",
"imgs":[
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I6/5a92689290fa7.jpg",
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I9/5a9268951f274.jpg",
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I1/5a9268971ff81.jpg",
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I4/5a92689a83e2d.jpg",
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I6/5a92689cd3547.jpg"
]
}
]
},
{
"type":,
"isShow":"",
"sort":,
"goods":[
{
"sku_id":"",
"operate_type":,
"index":,
"type":,
"product_num":"",
"search_name":"哈曼国际联合打造 高智能语音交互 智能家居 语音助手",
"short_name":"AI智能音箱",
"sku_no":"P002086-02",
"title":"斐讯(PHICOMM)AI智能音箱语音机器人 R1",
"img":"http://img.test.feelee.cc//Public/Uploads/goodsimg/I1/5aaba37587497.jpg",
"sell_price":"2499.00",
"activity_info":{
"productId":"P002086",
"skuNo":"P002086-02",
"productPrice":"00.00",
"costPrice":"00.00",
"activityId":null,
"activityType":null,
"title":null,
"status":"",
"isAct":false
},
"store_id":"",
"sell_nums":"",
"imgs":[
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I1/5aaba36149de9.jpg",
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I8/5aaba35eaa034.jpg",
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I1/5aaba2d5dc537.jpg",
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I8/5aaba2dce430a.jpg",
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I9/5aaba2dd303a5.jpg"
]
}
]
},
{
"type":,
"isShow":"",
"sort":,
"goods":[
{
"sku_id":"",
"operate_type":,
"index":,
"type":,
"product_num":"",
"search_name":"店铺标准版",
"short_name":"标准版",
"sku_no":"FL001001-04",
"title":"蜂雷云店--基础版",
"img":"http://img.test.feelee.cc//Public/Uploads/server/goods/20180409/93c7115232752884714.png",
"sell_price":"365.00",
"activity_info":{
"productId":"FL001001",
"skuNo":"FL001001-04",
"productPrice":"00.00",
"costPrice":"00.00",
"activityId":null,
"activityType":null,
"title":null,
"status":"",
"isAct":false
},
"store_id":"",
"sell_nums":"",
"imgs":[
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I4/5a715bc8d7c76.png"
]
},
{
"sku_id":"",
"operate_type":,
"index":,
"type":,
"product_num":"",
"search_name":"店铺标准版",
"short_name":"高级版",
"sku_no":"FL001001-06",
"title":"蜂雷云店--高级版",
"img":"http://img.test.feelee.cc//Public/Uploads/server/goods/20180409/93c7115232752884714.png",
"sell_price":"3650.00",
"activity_info":{
"productId":"FL001001",
"skuNo":"FL001001-06",
"productPrice":"00.00",
"costPrice":"00.00",
"activityId":null,
"activityType":null,
"title":null,
"status":"",
"isAct":false
},
"store_id":"",
"sell_nums":"",
"imgs":[
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I4/5a715bc8d7c76.png"
]
},
{
"sku_id":"",
"operate_type":,
"index":,
"type":,
"product_num":"",
"search_name":"店铺标准版",
"short_name":"基础版",
"sku_no":"FL001001-05",
"title":"蜂雷云店--标准版",
"img":"http://img.test.feelee.cc//Public/Uploads/server/goods/20180409/93c7115232752884714.png",
"sell_price":"1800.00",
"activity_info":{
"productId":"FL001001",
"skuNo":"FL001001-05",
"productPrice":"00.00",
"costPrice":"00.00",
"activityId":null,
"activityType":null,
"title":null,
"status":"",
"isAct":false
},
"store_id":"",
"sell_nums":"",
"imgs":[
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I4/5a715bc8d7c76.png"
]
},
{
"sku_id":"",
"operate_type":,
"index":,
"type":,
"product_num":"",
"search_name":"店铺标准版",
"short_name":"高级版",
"sku_no":"FL001001-07",
"title":"蜂雷云店--专业版",
"img":"http://img.test.feelee.cc//Public/Uploads/server/goods/20180409/93c7115232752884714.png",
"sell_price":"18000.00",
"activity_info":{
"productId":"FL001001",
"skuNo":"FL001001-07",
"productPrice":"00.00",
"costPrice":"00.00",
"activityId":null,
"activityType":null,
"title":null,
"status":"",
"isAct":false
},
"store_id":"",
"sell_nums":"",
"imgs":[
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I4/5a715bc8d7c76.png"
]
}
]
}
],
"store_info":{
"id":"",
"store_name":"邹柯的云店多少",
"store_desc":"",
"bgpath":null,
"short_number":"",
"invitation_code":"",
"qr_code":"http://img.test.feelee.cc//Public/Uploads/img/Qrcode/I4/115066910197999.png?v=1521541204",
"logopath":"http://img.test.feelee.cc//Public/Images/Common/userLogo.png",
"qrcode_desc":"蜂雷,赚钱从未如此简单!",
"url":"http://feeleeh5.com/cloud/advanced?store_id=115066910197999",
"store_version":""
},
"list_status":,
"shop_decorate_method":{
"head":"装修秘籍",
"list":[
{
"title":"1、第壹式:",
"content":"系统初始会使用“默认样式”,商品默认按照销量从高到低进行排列;"
},
{
"title":"2、第贰式:",
"content":"点击“选择样式”,即可选择店主精选的商品布局样式;哈哈,前提是有2套或以上的样式可选哦 ^o^"
},
{
"title":"3、第叁式:",
"content":"点击商品图片,可以更换商品;点击空白区域,可以添加商品;点击“删除”图标,可以删除商品;"
},
{
"title":"4、第肆式:",
"content":"选择完样式,设置完商品后,那赶紧点击“预览”看看装修成果吧;"
},
{
"title":"5、第伍式:",
"content":"最终确认无误后,点击右上角的“发布”,即可正式生效;"
},
{
"title":"6、第陆式:",
"content":"完。"
}
],
"foot":"若以上6式都已学会,那恭喜你,你可以毕业了,小蜜感到很欣慰;如果还有其他问题,可以联系我们客服小姐姐哦;"
}
}
}

    /**
* @title 旗舰版店铺首页
* @param type_id 否 int 要装修商品的类型(1-平台、2-特色)
* @param type 否 int 板块类型(0-店主精选、1-全部宝贝、2-热销Top100)
* @param sort 否 int 排序字段:type=1时必传(1销量由高到低、2价格由低到高、3价格由高到低)
* @param source 是 int 来源(1-H5、2-webApp)
* @param store_id 是 string 店铺id
* @param store_type 是 string 店铺标识(me本店,其他非本店)
* @param keywords 否 string 搜索(商品名称)
* @param page 否 int 页码(不传默认1)
* @param pageSize 否 int 每页显示条数(不传默认10)
* @example FlagShipShopDecorate.myHomeStore? 调试参数:{"keywords":"","source":"1","store_type":"other","username":"17721355485","check_code":"123456","method":"FlagShipShopDecorate.myHomeStore","type":"1","sort":"","store_id":"115075399495199","page":"1","pageSize":"20","type_id":"1"}
* @return_param_explain is_advanced_store_front:是否设置高级版店铺首页(1-是/2-否) is_store_decorate:是否设置店铺装修(1-是、2-否) store_info-- store_version:1-蜂雷云店标准版/2-专业版/3-蜂雷云店--基础版/4-蜂雷云店--标准版/5-蜂雷云店--高级版/6-蜂雷云店--专业版 url:分享的高级版店铺首页H5链接 qr_code:二维码 qrcode_desc:分享二维码描述 url_desc:链接分型提示 invitation_code:邀请码 store_name:店铺名称 store_desc:店铺简介 bgpath:店铺背景图 short_number:短编号 logopath:用户头像 isShow:是否显示名称价格信息(1是、2否) sort:位置排序值 goods_info-- imgs:海景图 product_num:该商品sku数 operate_type:1-显示商品、2-不显示商品 product_id:商品编号 search_name:商品搜索名称 short_name:商品短名称 sku_no:商品sku编号 sku_id:商品sku_id title:商品名称 img:商品图片 sell_price:商品售价 store_id:店铺id sell_nums:销量 type:模板样式子板块类型(4-海景、6-二宫格、8-三宫格、9-四宫格) activity_info--- activityId:活动编码 activityType:活动类型 productPrice:活动售价 costPrice:成本价 title:活动标题 isAct:是否是活动(true:是、false:不是) show_status:0-既不显示特色也不显示平台、1-只显示特色、2-只显示平台、3-即显示特色也显示平台
* @method POST
* @author 邹柯
*/
public function myHomeStore($res){
$self_user_id=session('user.user_id');
//0-店主精选、1-全部宝贝、2-热销Top100
$type=$res['type'];
if(empty($type)){
$type=;
}
if($type != && $type != && $type !=){
E('');
}
if($type==){
//排序字段(1销量由高到低、2价格由低到高、3价格由高到低)
$sort=$res['sort'];
if(empty($sort)){
$sort=;
}
if($sort != && $sort != && $sort !=){
E('');
}
}
$type_id=$res['type_id']; $store_id=$res['store_id'];
$store=M('store');
$store_info=$store->field('user_id')->where(['id'=>$store_id])->find();
$user_id=$store_info['user_id'];
$list['show_status']=$this->isHasTeseGoods($user_id,,$self_user_id);
if(empty($type_id)){
if($list['show_status']== || $list['show_status']==){
$type_id=;
}else{
$type_id=;
}
}
$store_type=$res['store_type'];
$source=$res['source'];
if($source != && $source !=){
E('');
}
$keywords=$res['keywords']; //页码
$page = $res['page'];
if(empty($page)){
$page=;
}
if(!is_numeric($page) || $page <= ){
E('');
} //每页显示条数
$pageSize = $res['pageSize'];
if(empty($pageSize)){
$pageSize=;
}
if(!is_numeric($pageSize) || $pageSize <= ){
E('');
}
//组装店铺信息
$list['store_info']=$this->getStoreInfoByStoreId($store_id);
//判断当前登陆用户是否是要访问的旗舰版店铺首页的下级
$flag=$this->isParentUserId($self_user_id,$user_id);
if($type==){
$user_shop_decorate=M('user_shop_decorate');
$usd_where['flagship_shop']=;
$usd_where['create_id']=$user_id;
if($type_id ==){
$usd_info=$user_shop_decorate->field('plate_id')->where($usd_where)->order('create_time desc')->find();
}else{
$usd_info=$user_shop_decorate->field('plate_id_features as plate_id,plate_content_features')->where($usd_where)->order('create_time desc')->find();
}
if(empty($usd_info)){
$plate_id=;
}else{
$plate_id=$usd_info['plate_id'];
}
if($list['show_status']==){
$list['goods_info']['list']=[];
}else{
if($type_id ==){
$list['goods_info']=$this->getShopDecorate($plate_id,,$store_id,$store_type,$source,$type_id);
}else{
if(empty($usd_info['plate_content_features'])){
$list['goods_info']=null;
}else{
$list['goods_info']=$this->getShopDecorate($plate_id,,$store_id,$store_type,$source,$type_id);
}
}
}
}elseif($type==){
if($sort==){
$order="gs.sell_nums desc";
}elseif($sort==){
$order="gs.sell_price asc";
}else{
$order="gs.sell_price desc";
}
$list['goods_info']=$this->getDefaultGoodsInfo(null,$order,$page,$pageSize,,$store_id,$store_type,$source,$keywords,$flag);
}else{
$list['goods_info']=$this->getDefaultGoodsInfo(,"sell_nums desc",$page,$pageSize,,$store_id,$store_type,$source,$keywords,$flag);
}
$store_extend=M('store_extend');
$se_where['user_id']=$user_id;
$store_version_id=$store_extend->field('store_id,version_id')->where($se_where)->find();
if(!empty($store_version_id)){
$store_version=M('store_version');
$sv_where['id']=$store_version_id['version_id'];
$s_info=$store_version->field('is_store_decorate,is_advanced_store_front')->where($sv_where)->find();
$list['is_store_decorate']=$s_info['is_store_decorate'];
$list['is_advanced_store_front']=$s_info['is_advanced_store_front'];
}else{
$list['is_store_decorate']=;
$list['is_advanced_store_front']=;
}
return $list;
}

返回结果

{
"status":"",
"errorCode":"",
"msg":"成功",
"result":{
"store_info":{
"logopath":"http://img.test.feelee.cc//Public/Images/Common/userLogo.png",
"qrcode_desc":"蜂雷,赚钱从未如此简单!",
"url":"http://feeleeh5.com/cloud/advanced?store_id=",
"store_version":null
},
"goods_info":{
"plate_id":,
"list":[
{
"type":,
"isShow":,
"sort":,
"goods":[
{
"imgs":[
"http://img.test.feelee.cc/Public/Uploads/img/I9/P001219/P001219-xyqsNNNDrC.jpg",
"http://img.test.feelee.cc/Public/Uploads/img/I5/P002975/P002975-65BSz8DPmY.jpg",
"http://img.test.feelee.cc/Public/Uploads/img/I5/P002975/P002975-409oFe6y5R.jpg",
"http://img.test.feelee.cc/Public/Uploads/img/I9/P001219/P001219-JsN1EpDf5p.jpg",
"http://img.test.feelee.cc/Public/Uploads/goodsimg/I9/5a1e81afa85f2.jpg"
],
"product_id":"P001219",
"search_name":"无线路由器wifi穿墙 信号放大 覆盖范围广",
"short_name":"斐讯K2",
"sku_no":"P001219-01",
"sku_id":"",
"title":"斐讯(PHICOMM)K2 1200M智能双频无线路由器 ",
"img":"http://img.test.feelee.cc//Public/Uploads/goodsimg/I0/5aa8d44648d05.jpg",
"sell_price":"399.00",
"sell_nums":"",
"store_id":"",
"activity_info":{
"productId":"P001219",
"skuNo":"P001219-01",
"productPrice":"00.00",
"costPrice":"00.00",
"activityId":null,
"activityType":null,
"title":null,
"status":"",
"isAct":false
},
"type":,
"index":
}
]
}
],
"foot":{
"current_page":"",
"pagesize":"",
"total_page":
}
},
"is_store_decorate":"",
"is_advanced_store_front":""
}
}
private function getShopDecorateInfoNew($plate_id,$store_id,$type_id){
$shop_decorate_template=M('shop_decorate_template');
$where['status']=;
$where['id']=$plate_id;
$list=$shop_decorate_template->field('id,plate_content,goods_nums')->where($where)->find();
$plate_content=json_decode($list['plate_content'],true);
if($type_id==){
$goods_info=$this->getDefaultGoodsInfo($list['goods_nums'],"sell_nums desc",null,null,null,null,null,null,null,null,);
}else{
$goods_info=$this->getDefaultGoodsNull($list['goods_nums'],$type_id); $sku_ids=array_unique(array_column($goods_info,'sku_id'));
$sku_info=$this->getGoodsInfo($sku_ids,$store_id,'me',);
foreach($goods_info as $k=>$v){
$goods_info[$k]['product_id']=$sku_info[$v['sku_id']]['product_id'];
$goods_info[$k]['sku_no']=$sku_info[$v['sku_id']]['sku_no'];
}
}
//查询商品是否有多个sku
$str=$this->getMultiSku($goods_info);
foreach($goods_info as $k=>$v){
$data[]=array(
'productId'=>$v['product_id'],
'skuNo'=>$v['sku_no']
);
$sk[$v['sku_id']]=$v['sku_no'];
}
$home_special_session=new HomeSpecialSessionModel();
$res_info=$home_special_session->getGoodsActInfo($data);
foreach($goods_info as $k=>$v){
$goods_info[$k]['activity_info']=$res_info[$sk[$v['sku_id']]];
if($type_id==){
$goods_info[$k]['operate_type']=;
}else{
$goods_info[$k]['operate_type']=;
}
$goods_info[$k]['index']=$k+;
if($type_id==){
$goods_info[$k]['search_name']=$sku_info[$v['sku_id']]['search_name'];
$goods_info[$k]['short_name']=$sku_info[$v['sku_id']]['short_name'];
$goods_info[$k]['sku_no']=$sku_info[$v['sku_id']]['sku_no'];
$goods_info[$k]['title']=$sku_info[$v['sku_id']]['title'];
$goods_info[$k]['img']=$sku_info[$v['sku_id']]['img'];
$goods_info[$k]['sell_price']=$sku_info[$v['sku_id']]['sell_price'];
$goods_info[$k]['store_id']=$sku_info[$v['sku_id']]['store_id'];
$goods_info[$k]['sell_nums']=$sku_info[$v['sku_id']]['sell_nums'];
$goods_info[$k]['imgs']=$sku_info[$v['sku_id']]['imgs'];
}
}
$total_nums=;
foreach($plate_content as $k=>$v){
$at=array_slice($goods_info,$total_nums,$v['goods_nums']);
foreach($at as $k2=>$v2){
$at[$k2]['type']=$v['type'];
$at[$k2]['sort']=$v['sort'];
$at[$k2]['isShow']=$v['isShow'];
if($v['type'] !=){
$at[$k2]['product_num']='';
}else{
$at[$k2]['product_num']=$str[$v2['product_id']];
}
}
$plate_content[$k]['goods']=$at;
$total_nums +=$v['goods_nums'];
unset($plate_content[$k]['goods_nums']);
}
$arrs['plate_id']=$plate_id;
$arrs['list']=$plate_content;
return $arrs;
}
    //判断当前登陆用户是否是要访问的旗舰版店铺首页的下级
public function isParentUserId($user_id,$store_user_id){
if(empty($user_id)){
return false;
}
$customer=M('customer');
$c_info=$customer->field('partent_user_id')->where(['user_id'=>$user_id])->find();
if($c_info['partent_user_id']==$store_user_id || $user_id==$store_user_id){
return true;
}
return false;
}
    /**
* @title 判断是否有特色商品
* @param store_id 是 string 店铺id
* @example FlagShipShopDecorate.getHasTeseGoods? 调试参数:{"username":"17721355485","check_code":"123456","method":"FlagShipShopDecorate.getHasTeseGoods","store_id":"115075399495199"}
* @return {"status":"0","errorCode":"0","msg":"成功","result":{"list_status":1}}
* @return_param_explain list_status:1-有特色商品、2-无特色商品
* @method POST
* @author 邹柯
*/
public function getHasTeseGoods($res){
$store_id=$res['store_id'];
$store_goods=M('store_goods');
$sg_where['store_id']=$store_id;
$sg_where['is_deleted']=;
$sg_where['is_open']=;
$count=$store_goods->field()->where($sg_where)->count();
if($count==){
$data['list_status']=;
}else{
$data['list_status']=;
}
return $data;
}
    //判断当前店铺下是否有特色商品
//$status 1.预览(草稿) 2.发布 0-既不显示特色也不显示平台、1-只显示特色、2-只显示平台、3-即显示特色也显示平台
public function isHasTeseGoods($user_id,$status,$self_user_id){
$user_shop_decorate=M('user_shop_decorate');
$usd_where['create_id']=$user_id;
$usd_where['flagship_shop']=;
$usd_info=$user_shop_decorate->field('use_status,plate_content_draft,plate_content,plate_content_draft_features,plate_content_features')->where($usd_where)->find();
if(empty($usd_info)){
return ;
}
if($status==){
if(empty($usd_info['plate_content_draft_features']) && empty($usd_info['plate_content_draft'])){
return ;
}elseif(!empty($usd_info['plate_content_draft_features']) && empty($usd_info['plate_content_draft'])){
return ;
}elseif(empty($usd_info['plate_content_draft_features']) && !empty($usd_info['plate_content_draft'])){
return ;
}else{
return ;
}
}else{
if(empty($self_user_id)){
if(empty($usd_info['plate_content_features'])) {
return ;
}else{
return ;
}
}
if(empty($usd_info['plate_content_features']) && empty($usd_info['plate_content'])){
return ;
}elseif(!empty($usd_info['plate_content_features']) && empty($usd_info['plate_content'])){
return ;
}elseif(empty($usd_info['plate_content_features']) && !empty($usd_info['plate_content'])){
return ;
}else{
return ;
}
}
return ;
}
    //获取店铺装修秘籍
public function getShopDecorateMethod(){
$arr['head']="装修秘籍";
$arr['list']=[
[
'title'=>'1、第壹式:',
'content'=>'系统初始会使用“默认样式”,商品默认按照销量从高到低进行排列;',
],[
'title'=>'2、第贰式:',
'content'=>'点击“选择样式”,即可选择店主精选的商品布局样式;哈哈,前提是有2套或以上的样式可选哦 ^o^',
],[
'title'=>'3、第叁式:',
'content'=>'点击商品图片,可以更换商品;点击空白区域,可以添加商品;点击“删除”图标,可以删除商品;',
],[
'title'=>'4、第肆式:',
'content'=>'选择完样式,设置完商品后,那赶紧点击“预览”看看装修成果吧;',
],[
'title'=>'5、第伍式:',
'content'=>'最终确认无误后,点击右上角的“发布”,即可正式生效;',
],[
'title'=>'6、第陆式:',
'content'=>'完。',
],
];
$arr['foot']="若以上6式都已学会,那恭喜你,你可以毕业了,小蜜感到很欣慰;如果还有其他问题,可以联系我们客服小姐姐哦;";
return $arr;
}
    //获取商品详情
private function getGoodsInfo($sku_ids,$store_id,$store_type,$source){
$img_url=rtrim(C('img_base'),'/');
$goods_sku_m=M('goods_sku gs');
//根据sku_id查找对应的商品
$where['gs.sku_id'] =array("in",$sku_ids);
$goods_info = $goods_sku_m->join('left join __GOODS__ gd on gd.product_id=gs.product_id')
->field('seascapes,gs.product_id,gs.sku_no,gd.search_name,gs.short_name,gs.sku_no,gs.sku_id,gs.title,concat("'.$img_url.'",gs.img) as img,gs.sell_price,gs.sell_nums')
->where($where)
->select();
foreach($goods_info as $k=>$v){
$v['imgs']=$this->getHaiJing($v['seascapes']);
$arr[$v['sku_id']]=$v;
$arr[$v['sku_id']]['store_id']=$this->getStoreId($store_id,$store_type,$source,$v['sku_id']);
}
return $arr;
}
//获取默认模板所需要的商品
private function getDefaultGoodsInfo($limit,$order,$page,$pageSize,$ori,$store_id,$store_type,$source,$keywords,$flag){
$img_url=rtrim(C('img_base'),'/');
$goods_sku_m=M('goods_sku gs');
//根据sku_id查找对应的商品
if($flag==false){ //不是下级或用户未登录
$where="gs.is_show=0 and gs.status=1 and gs.is_deleted=0 and gd.is_deleted=0 and gd.is_online=1 and sg.is_deleted=1 and sg.is_open=1 and sg.store_id='$store_id' and gs.goods_type=2";
}else{
$where="gs.is_show=0 and gs.status=1 and gs.is_deleted=0 and gd.is_deleted=0 and gd.is_online=1 and sg.is_deleted=1 and sg.is_open=1 and (sg.store_id='$store_id' or sg.store_id is null)";
}
if(!empty($keywords)){
$where .=" and (gs.title like '%$keywords%' or gd.search_name like '%$keywords%' or gs.short_name like '%$keywords%')";
}
if(empty($page)){
$list = $goods_sku_m->join('left join __GOODS__ gd on gd.product_id=gs.product_id')
->join('left join __STORE_GOODS__ sg on sg.sku_id=gs.sku_id')
->field('gd.seascapes,gs.product_id,gd.search_name,gs.short_name,gs.sku_no,gs.sku_id,gs.title,concat("'.$img_url.'",gs.img) as img,gs.sell_price,sum(gs.sell_nums) as sell_nums')
->where($where)
->order($order)
->limit($limit)
->group('gs.product_id')
->select();
foreach($list as $k=>$v){
$list[$k]['store_id']=$this->getStoreId($store_id,$store_type,$source,$v['sku_id']);
$list[$k]['imgs']=$this->getHaiJing($v['seascapes']);
$data[]=array(
'productId'=>$v['product_id'],
'skuNo'=>$v['sku_no']
);
} $home_special_session=new HomeSpecialSessionModel();
$res_info=$home_special_session->getGoodsActInfo($data);
foreach($list as $k=>$v){
$list[$k]['activity_info']=$res_info[$v['sku_no']];
$list[$k]['operate_type']=;
}
}else{
if($ori==){
$count = $goods_sku_m->join('left join __GOODS__ gd on gd.product_id=gs.product_id')
->join('left join __STORE_GOODS__ sg on sg.sku_id=gs.sku_id')
->where($where)
->count('DISTINCT gs.product_id');
$goods_info = $goods_sku_m->join('left join __GOODS__ gd on gd.product_id=gs.product_id')
->join('left join __STORE_GOODS__ sg on sg.sku_id=gs.sku_id')
->field('gd.seascapes,gs.product_id,gd.search_name,gs.short_name,gs.sku_no,gs.sku_id,gs.title,concat("'.$img_url.'",gs.img) as img,gs.sell_price,gs.sell_nums')
->where($where)
->order($order)
->group('gs.product_id')
->page($page,$pageSize)
->select();
}else{
$count =$limit;
$sql = $goods_sku_m->join('left join __GOODS__ gd on gd.product_id=gs.product_id')
->join('left join __STORE_GOODS__ sg on sg.sku_id=gs.sku_id')
->field('gd.seascapes,gs.product_id,gd.search_name,gs.short_name,gs.sku_no,gs.sku_id,gs.title,concat("'.$img_url.'",gs.img) as img,gs.sell_price,gs.sell_nums')
->where($where)
->order($order)
->group('gs.product_id')
->limit($limit)
->select(false);
try{
$goods_info=M()->table(sprintf('(%s) a', $sql) )->page($page,$pageSize)->select();
}catch (\Exception $e){
echo($e->getMessage());
}
//组装分页信息
$count=count($goods_info);
}
foreach($goods_info as $k=>$v){
$data[]=array(
'productId'=>$v['product_id'],
'skuNo'=>$v['sku_no']
);
}
$home_special_session=new HomeSpecialSessionModel();
$res_info=$home_special_session->getGoodsActInfo($data);
foreach($goods_info as $k=>$v){
$goods_info[$k]['store_id']=$this->getStoreId($store_id,$store_type,$source,$v['sku_id']);
$goods_info[$k]['activity_info']=$res_info[$v['sku_no']];
$goods_info[$k]['type']=;
$goods_info[$k]['isShow']=;
$goods_info[$k]['index']=$k+;
$goods_info[$k]['imgs']=$this->getHaiJing($v['seascapes']);
}
$total_page=ceil($count/$pageSize); $list['plate_id']=;
if(empty($goods_info)){
$foot=array('current_page'=>$page,'pagesize'=>$pageSize,'total_page'=>);
$list['list']=null;
}else{
$foot=array('current_page'=>$page,'pagesize'=>$pageSize,'total_page'=>$total_page);
$list['list']=array(
array(
'type'=>,
'isShow'=>,
'sort'=>,
'goods'=>$goods_info
)
);
}
$list['foot']=$foot;
} return $list;
}
    //获取店铺id信息
private function getStoreId($store_id,$store_type,$source,$sku_id){
$ob=new PublicModel();
if($source==){
$inf=$ob->shopDeal($store_id);
}else{ //h5
$inf=$ob->shopDealH5($store_id,$store_type);
}
$infs=$ob->getTeSeGoods($sku_id);
if(empty($infs)){//平台商品
$store_id=$inf;
}else{
$store_id=$infs['store_id'];
}
return $store_id;
}
    //获取店铺装修信息
private function getShopDecorateInfo($plate_id,$type,$store_id,$type_id){
$user_id=session("user.user_id");
$user_shop_decorate=M('user_shop_decorate');
$usd_where['flagship_shop']=;
$usd_where['create_id']=$user_id;
if($type_id==){
$usd_info=$user_shop_decorate->field('id,plate_content,plate_content_draft,plate_content_features,plate_content_draft_features')->where($usd_where)->find();
}else{
$usd_info=$user_shop_decorate->field('id,plate_content_features plate_content,plate_content_draft_features plate_content_draft')->where($usd_where)->find();
}
if(!empty($usd_info)){
if($type==){
$plate_content=json_decode($usd_info['plate_content_draft'],true);
}else{
$plate_content=json_decode($usd_info['plate_content'],true);
}
foreach($plate_content as $k=>$v){
foreach($v['goods'] as $k2=>$v2){
if(!empty($v2['sku_id'])){
$arr[]=$v2['sku_id'];
}
}
}
$sku_info=$this->getGoodsInfo($arr,$store_id,'me',);
foreach($sku_info as $k=>$v){
$data[]=array(
'productId'=>$v['product_id'],
'skuNo'=>$v['sku_no']
);
$sk[$v['sku_id']]=$v['sku_no'];
}
$home_special_session=new HomeSpecialSessionModel();
$res_info=$home_special_session->getGoodsActInfo($data);
//查询商品是否有多个sku
$str=$this->getMultiSku($sku_info);
foreach($plate_content as $k=>$v){
foreach($v['goods'] as $k2=>$v2){
$plate_content[$k]['goods'][$k2]['type']=$v['type'];
$plate_content[$k]['goods'][$k2]['sort']=$v['sort'];
$plate_content[$k]['goods'][$k2]['isShow']=$v['isShow'];
if($v['type'] !=){
$plate_content[$k]['goods'][$k2]['product_num']='';
}else{
$plate_content[$k]['goods'][$k2]['product_num']=$str[$sku_info[$v2['sku_id']]['product_id']];
}
$plate_content[$k]['goods'][$k2]['search_name']=$sku_info[$v2['sku_id']]['search_name'];
$plate_content[$k]['goods'][$k2]['short_name']=$sku_info[$v2['sku_id']]['short_name'];
$plate_content[$k]['goods'][$k2]['sku_no']=$sku_info[$v2['sku_id']]['sku_no'];
$plate_content[$k]['goods'][$k2]['title']=$sku_info[$v2['sku_id']]['title'];
$plate_content[$k]['goods'][$k2]['img']=$sku_info[$v2['sku_id']]['img'];
$plate_content[$k]['goods'][$k2]['sell_price']=$sku_info[$v2['sku_id']]['sell_price'];
$plate_content[$k]['goods'][$k2]['activity_info']=$res_info[$sk[$v2['sku_id']]];
$plate_content[$k]['goods'][$k2]['store_id']=$sku_info[$v2['sku_id']]['store_id'];
$plate_content[$k]['goods'][$k2]['sell_nums']=$sku_info[$v2['sku_id']]['sell_nums'];
$plate_content[$k]['goods'][$k2]['imgs']=$sku_info[$v2['sku_id']]['imgs'];
}
}
$arrs['plate_id']=$plate_id;
$arrs['list']=$plate_content;
return $arrs;
}else{
$shop_decorate_template=M('shop_decorate_template');
$where['status']=;
$where['id']=$plate_id;
$list=$shop_decorate_template->field('id,plate_content,goods_nums')->where($where)->find();
$plate_content=json_decode($list['plate_content'],true);
$goods_info=$this->getDefaultGoodsInfo($list['goods_nums'],"sell_nums desc");
//查询商品是否有多个sku
$str=$this->getMultiSku($goods_info);
foreach($goods_info as $k=>$v){
$data[]=array(
'productId'=>$v['product_id'],
'skuNo'=>$v['sku_no']
);
$sk[$v['sku_id']]=$v['sku_no'];
}
$home_special_session=new HomeSpecialSessionModel();
$res_info=$home_special_session->getGoodsActInfo($data);
foreach($goods_info as $k=>$v){
$goods_info[$k]['activity_info']=$res_info[$sk[$v['sku_id']]];
$goods_info[$k]['operate_type']=;
if($v['type'] !=){
$goods_info[$k]['product_num']='';
}else{
$goods_info[$k]['product_num']=$str[$v['product_id']];
}
$goods_info[$k]['index']=$k+;
}
$total_nums=;
foreach($plate_content as $k=>$v){
$at=array_slice($goods_info,$total_nums,$v['goods_nums']);
foreach($at as $k2=>$v2){
$at[$k2]['type']=$v['type'];
$at[$k2]['sort']=$v['sort'];
$at[$k2]['isShow']=$v['isShow'];
}
$plate_content[$k]['goods']=$at;
$total_nums +=$v['goods_nums'];
unset($plate_content[$k]['goods_nums']);
}
$arrs['plate_id']=$plate_id;
$arrs['list']=$plate_content;
return $arrs;
}
}
    //获取店铺装修信息
private function getShopDecorate($plate_id,$type,$store_id,$store_type,$source,$type_id){
$store=M('store');
$store_info=$store->field('user_id')->where(['id'=>$store_id])->find();
$user_id=$store_info['user_id']; $user_shop_decorate=M('user_shop_decorate');
$usd_where['flagship_shop']=;
$usd_where['create_id']=$user_id;
if($type_id==){
$usd_where['plate_id']=$plate_id;
$usd_info=$user_shop_decorate->field('id,plate_content,plate_content_draft')
->where($usd_where)
->order('create_time desc')
->find();
}else{
$usd_where['plate_id_features']=$plate_id;
$usd_info=$user_shop_decorate->field('id,plate_content_features plate_content,plate_content_draft_features plate_content_draft')
->where($usd_where)
->order('create_time desc')
->find();
} if(!empty($usd_info)){
if($type==){
$plate_content=json_decode($usd_info['plate_content_draft'],true);
}else{
$plate_content=json_decode($usd_info['plate_content'],true);
}
foreach($plate_content as $k=>$v){
foreach($v['goods'] as $k2=>$v2){
$arr[]=$v2['sku_id'];
}
}
$sku_info=$this->getGoodsInfo($arr,$store_id,$store_type,$source); foreach($sku_info as $k=>$v){
$data[]=array(
'productId'=>$v['product_id'],
'skuNo'=>$v['sku_no']
);
$sk[$v['sku_id']]=$v['sku_no'];
}
$home_special_session=new HomeSpecialSessionModel();
$res_info=$home_special_session->getGoodsActInfo($data);
//查询商品是否有多个sku
$str=$this->getMultiSku($sku_info);
foreach($plate_content as $k=>$v){
foreach($v['goods'] as $k2=>$v2){
$plate_content[$k]['goods'][$k2]['type']=$v['type'];
$plate_content[$k]['goods'][$k2]['isShow']=$v['isShow'];
if($v['type'] !=){
$plate_content[$k]['goods'][$k2]['product_num']='';
}else{
$plate_content[$k]['goods'][$k2]['product_num']=$str[$sku_info[$v2['sku_id']]['product_id']];
}
$plate_content[$k]['goods'][$k2]['search_name']=$sku_info[$v2['sku_id']]['search_name'];
$plate_content[$k]['goods'][$k2]['short_name']=$sku_info[$v2['sku_id']]['short_name'];
$plate_content[$k]['goods'][$k2]['sku_no']=$sku_info[$v2['sku_id']]['sku_no'];
$plate_content[$k]['goods'][$k2]['title']=$sku_info[$v2['sku_id']]['title'];
$plate_content[$k]['goods'][$k2]['img']=$sku_info[$v2['sku_id']]['img'];
$plate_content[$k]['goods'][$k2]['sell_price']=$sku_info[$v2['sku_id']]['sell_price'];
$plate_content[$k]['goods'][$k2]['activity_info']=$res_info[$sk[$v2['sku_id']]];
$plate_content[$k]['goods'][$k2]['store_id']=$sku_info[$v2['sku_id']]['store_id'];
$plate_content[$k]['goods'][$k2]['sell_nums']=$sku_info[$v2['sku_id']]['sell_nums'];
$plate_content[$k]['goods'][$k2]['imgs']=$sku_info[$v2['sku_id']]['imgs'];
}
}
$arrs['plate_id']=$plate_id;
$arrs['list']=$plate_content;
return $arrs;
}else{
$shop_decorate_template=M('shop_decorate_template');
$where['status']=;
$where['is_default']=;
$list=$shop_decorate_template->field('id,plate_content,goods_nums')->where($where)->find();
$plate_content=json_decode($list['plate_content'],true);
$goods_info=$this->getDefaultGoodsInfo($list['goods_nums'],"sell_nums desc",null,null,null,$store_id,$store_type);
//查询商品是否有多个sku
$str=$this->getMultiSku($goods_info);
foreach($goods_info as $k=>$v){
$data[]=array(
'productId'=>$v['product_id'],
'skuNo'=>$v['sku_no']
);
$sk[$v['sku_id']]=$v['sku_no'];
}
$home_special_session=new HomeSpecialSessionModel();
$res_info=$home_special_session->getGoodsActInfo($data);
foreach($goods_info as $k=>$v){
$goods_info[$k]['activity_info']=$res_info[$sk[$v['sku_id']]];
if($v['type'] !=){
$goods_info[$k]['product_num']='';
}else{
$goods_info[$k]['product_num']=$str[$v['product_id']];
}
$goods_info[$k]['index']=$k+;
}
$total_nums=;
foreach($plate_content as $k=>$v){
$at=array_slice($goods_info,$total_nums,$v['goods_nums']);
foreach($at as $k2=>$v2){
$at[$k2]['type']=$v['type'];
$at[$k2]['sort']=$v['sort'];
$at[$k2]['isShow']=$v['isShow'];
}
$plate_content[$k]['goods']=$at;
$total_nums +=$v['goods_nums'];
unset($plate_content[$k]['goods_nums']);
}
$arrs['plate_id']=$plate_id;
$arrs['list']=$plate_content;
return $arrs;
}
}
    //查询商品是否有多个sku
public function getMultiSku($goods_info){
$public = new \Common\Model\DataModel\PublicModel();
$product_info=$public->isMoreSku(array_column($goods_info,'product_id'));
$new_data=[];
foreach ($product_info as $key=>$value){
$new_data[$value['product_id']]=empty($value['num'])?'':$value['num'];
}
return $new_data;
}
    //获取店铺信息
public function getStoreInfoByStoreId($store_id){
$img_url=rtrim(C('img_base'),'/');
$public = new PublicModel();
$store=M('store');
$store_info=$store->field('id,user_id,name as store_name,introduction as store_desc,concat("'.$img_url.'",bgpath) as bgpath,short_number,invitation_code')
->where('id="'.$store_id.'"')
->find(); //根据user_id获取个人头像
$u=M('user')->field('head_pic')->where(array('user_id'=>$store_info['user_id']))->find();
if(empty($u['head_pic'])){
$store_info['logopath']=$img_url.C('user_logo');
}else{
$store_info['logopath']=$public->getHeadPic($u['head_pic']);
}
$store_info['qrcode_desc']=C("qrcode_desc");
$store_info['url_desc']=C("url_desc");
$store_info['url']=C("h5_base")."cloud/flagship?store_id=".$store_id;
$ob=new AccountModel();
$store_info['qr_code']=$img_url.$ob->getQrCode($store_info['user_id'],$store_info['url'],'');
$store_extend=M('store_extend');
$se_info=$store_extend->field('version_id')->where(['store_id'=>$store_info['id']])->find();
$store_info['store_version']=$se_info['version_id'];
return $store_info;
    //商品海景图处理
public function getHaiJing($imgs){
$img_base=rtrim(C('img_base'),'/');
$imgs = explode(',', $imgs);
if($imgs){
$imgs_t=array();
foreach($imgs as $v){
$imgs_t[]=empty($v)?'':$img_base.$v;
}
}
return $imgs_t;
}

php 实现店铺装修6的更多相关文章

  1. 关于淘宝店铺装修弹出层popup的记录

    小龙最近做了一下下淘宝的店铺装修,里面封装的widget深不见底,刚刚整明白popup,也就是弹出层的使用方法,大神勿喷: <div class="area001">触 ...

  2. Adobe Photoshop CC2018最新教程+某宝店铺装修教程

    PS免费教程,ps淘宝店铺装修教程.该资源为本人从某商网站重金买来,现免费分享给大家,下载地址:百度网盘,https://pan.baidu.com/s/127PjFbGwVVUVce1litHFsw

  3. php 实现店铺装修5

    /** * @title 选中蜂店装修模板样式 * @param plate_id 是 int 商品(平台或特色)装修样式ID * @param type_id 是 int 要装修商品的类型(1-平台 ...

  4. php 实现店铺装修7

    type_id=0的情况 type_id=1的情况                         type_id=2的情况 /** * @title 店铺装修--商品分类 * @param type ...

  5. php 实现店铺装修8

    /** * @title 店铺装修--根据分类获取商品列表 * @param source 是 int 来源(1--h5.2--app) * @param type 是 string 店铺类型--首页 ...

  6. php 实现店铺装修3

    /** * @title 装修店铺 * @param plate_id 是 int 店铺装修样式ID * @param type 是 int 模板样式子板块类型(4-海景.6-二宫格.8-三宫格.9- ...

  7. php 实现店铺装修2

    <?php namespace Webapp\Model; use Common\Model\DataModel\FlagShopCategoryModel; use Common\Model\ ...

  8. php 实现店铺装修1

    一.原型分析 1.店铺未装修的情况下,使用默认样式,哪个是默认样式由后台告知: 2.所有的样式由后台进行维护(但后台始终有一个默认样式,不可删除不可编辑),所有样式,只要用户未编辑过,则默认按照商品的 ...

  9. php 实现店铺装修4

    /** * @title 发布装修的店铺 * @example FlagShipShopDecorate.fabu? 调试参数:{"username":"17721355 ...

随机推荐

  1. PHP序列化与反序列化(二)

    题目(攻防世界): __construct和__destruct的魔术方法是默认执行的,我们可以忽视他们,__wake up执行以后会返回当前主页上,需要绕过,下面的正则匹配preg_match也需要 ...

  2. JS利用HTML5的Web Worker实现多线程

    需求:有一个长时间的斐波拉契的计算希望放在分线程中计算,计算的得到结果后再返回给主线程展示,再计算的时候不冻结页面 var number = 55;//传入分线程的参数 var worker = ne ...

  3. 解决前端项目启动时报错:Use // eslint-disable-next-line to ignore the next line.

    首先说一下这个问题产生的原因: 项目创建时设置了使用 eslint 进行代码规范检查. 解决办法: 找到webpack.base.conf.js文件,并且将下满这行代码注释掉. ...(config. ...

  4. 吴裕雄--天生自然Numpy库学习笔记:NumPy 算术函数

    NumPy 算术函数包含简单的加减乘除: add(),subtract(),multiply() 和 divide(). 需要注意的是数组必须具有相同的形状或符合数组广播规则. import nump ...

  5. Cisco AP-格式化AP

    故障情况:APC11-AP04#sho capwap ip config LWAPP Static IP ConfigurationIP Address         172.17.239.204I ...

  6. 对于java中反编译命令的使用以及Integer包装类的查看

    Integer是基于int的包装类 我们可以用测试代码来看看Integer类是如何实现装箱和拆箱的 public class BoxAndUnbox { /** * @param args */ pu ...

  7. js脚本中执行java后台代码

    使用场景:关闭页面弹窗时执行sql语句. 其实js里执行sql语句有多种方式. 方式一:直接在js代码里调用sql语句,原则上不能使用,因为这将sql直接暴露在客户端,安全性极差. 方式二:在js里运 ...

  8. java中关于&0xFF 的问题

    最近遇到一个问题,半天也没想明白,byte temp = 0xA0,为什么System.out.println(temp),打印的值为:-96:而System.out.println(temp& ...

  9. Android获取当前时间的3中方法总结

    今天听了一在线公开课,任务是做一个数字时钟,其中最关键的自然是获取当前的系统时间.做个简单的记录,如下: 1. Time time = new Time("GMT+8"); tim ...

  10. Vacuum Pump Manufacturer Introduction: Airless Pump Bottle

    Fillable vacuum pump bottle with matt silver aluminum base and cap and shiny silver aluminum collar. ...