/**
* @title 选中蜂店装修模板样式
* @param plate_id 是 int 商品(平台或特色)装修样式ID
* @param type_id 是 int 要装修商品的类型(1-平台、2-特色)
* @example FlagShipShopDecorate.selectShopDecorate? 调试参数:{"username":"17721355485","check_code":"123456","method":"FlagShipShopDecorate.selectShopDecorate","plate_id":"71","type_id":"1"}
* @return {"status":"0","errorCode":"0","msg":"成功","result":[]}
* @method POST
* @author 邹柯
*/
public function selectShopDecorate($res){
$user_id=session("user.user_id");
$plate_id=$res['plate_id'];
if(empty($plate_id)){
E('');
}
$type_id=$res['type_id'];
if($type_id != && $type_id !=){
E('');
}
$user_shop_decorate=M('user_shop_decorate');
$usd_where['create_id']=$user_id;
$usd_where['flagship_shop']=;
$count=$this->getDecorate($user_shop_decorate,$usd_where);
$plate_content=$this->getDefaultStyleByPlateId($plate_id,$type_id);
$plate_content_draft=json_encode($plate_content);
$time=date("Y-m-d H:i:s",time());
if($type_id==){
$field1="plate_content_draft";
$field2="plate_id";
$field3="select_status";
}else{
$field1="plate_content_draft_features";
$field2="plate_id_features";
$field3="select_status_features";
}
if(empty($count)){
$data=array(
$field2=>$plate_id,
$field1=>$plate_content_draft,
'status'=>,
'create_time'=>$time,
'create_id'=>$user_id,
'update_time'=>$time,
'update_id'=>$user_id,
'use_status'=>,
$field3=>,
'flagship_shop'=>
);
$res=$user_shop_decorate->data($data)->add();
if(!$res && $res !=){
E('');
}
}else{
if($count['use_status']==){
$use_status=;
}else{
$use_status=;
}
if($type_id==){
if($count['plate_id']==$plate_id){
return true;
}
}else{
if($count['plate_id_features']==$plate_id){
return true;
}
} $data=array(
$field2=>$plate_id,
$field1=>$plate_content_draft,
'status'=>,
'create_time'=>$time,
'create_id'=>$user_id,
'update_time'=>$time,
'update_id'=>$user_id,
'use_status'=>$use_status,
$field3=>
);
$res=$user_shop_decorate->data($data)->where(['id'=>$count['id']])->save();
if(!$res && $res !=){
E('');
}
}
return true;
}
//获取店铺装修信息
public function getDecorate($user_shop_decorate,$usds_where){
$res_info=$user_shop_decorate->field('id,plate_id,plate_id_features,use_status,plate_content_draft,plate_content_draft_features')
->where($usds_where)
->order('create_time desc')
->find();
return $res_info;
}

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

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

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

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

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

  3. php 实现店铺装修6

    /** * @title 获取预览或发布的蜂店模板样式 * @param store_id 是 string 店铺id * @param type 是 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. Educational Codeforces Round 82 A. Erasing Zeroes

    You are given a string ss. Each character is either 0 or 1. You want all 1's in the string to form a ...

  2. [蓝桥杯2017初赛]k倍区间 前缀和

    题目描述 给定一个长度为N的数列,A1, A2, ... AN. 如果其中一段连续的子序列Ai, Ai+1, ... Aj(i <= j)之和是K的倍数,我们就称这个区间[i, j]是K倍区间. ...

  3. Linux终端的一些快捷键命令

    一.初识linux的终端种类:本地.远程 查看本终端命令: #tty 命令,看到当前所处的终端 #(w)who 命令,看到系统中所有登录的用户 其中,tty 终端为表示在本地命令行模式下打开的终端:p ...

  4. idea2018.3.6,离线使用maven的方法

    (1)想办法拷贝联网电脑上已经下载好的仓库文件夹mavenRepository到离线环境的电脑上: (2)idea中按照如下图中配置: (3)打开 User settings file中设置的sett ...

  5. 收藏---wordpress搭建出来的blog

    http://blog.luofei.org/2012/02/painters-and-paintings-through-the-eyes-of-faith/

  6. 三级联动的区域选择器 iOS组件

    在iOS开发中,多级联动选择器非常常见,一般用于条件筛选,区域选择等. 实现了一个找房 APP 的筛选功能,效果如下: 代码如下:https://github.com/zhangtibin/Condi ...

  7. vb.net与vb的区别

    本文链接:https://blog.csdn.net/dfshsdr/article/details/63255645最近接触了vb.net,它增加了vb的很多特性,而且演化成为完全面向对象的编程语言 ...

  8. iOS开发架构学习记录

    闲着没事看了一些iOS开发架构的视频,简单的介绍了几个常用的架构设计,现将它记录如下,以后有时间再专门写这方面的内容,大家可以看看,感兴趣的就进一步学习. 一.架构基础 1.架构设计的目的 进一步解耦 ...

  9. 入门项目数字手写体识别:使用Keras完成CNN模型搭建(重要)

    摘要: 本文是通过Keras实现深度学习入门项目——数字手写体识别,整个流程介绍比较详细,适合初学者上手实践. 对于图像分类任务而言,卷积神经网络(CNN)是目前最优的网络结构,没有之一.在面部识别. ...

  10. 吴裕雄--天生自然ORACLE数据库学习笔记:Oracle系统调优

    --修改 alter system set large_pool_size=64m; --显示 show parameter large_pool_size; select sum(getmisses ...