/**
* @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. Cisco 3702i TX功率图

    有关思科TX Power选择的一些基本信息: 思科使用1到8的等级,其中1是最高功率,8是最低功率虽然比例上升到8,但不是每个band都使用(0-7)8个数据中的所有值.每个数字都有一个相应的dBm值 ...

  2. kafka connector

    Kafka Connect 是一种用于在 Kafka 和其他系统之间可扩展的.可靠的的流式传输数据的工具.它使得能偶快速定义将大量数据集合移入和移除 kafka 连接器变得简单. kafka conn ...

  3. leetcode 0205

    目录 700 二叉搜索树中的搜索 175 组合两个表 仍旧不理解 left join 590. N叉树的后序遍历 递归: 迭代: 589 N叉树的前序遍历 递归, 注意 递归 过程中附带的 actio ...

  4. nyoj 24

    素数距离问题 时间限制:3000 ms  |  内存限制:65535 KB 难度:2   描述 现在给出你一些数,要求你写出一个程序,输出这些整数相邻最近的素数,并输出其相距长度.如果左右有等距离长度 ...

  5. mysql 表这段内容替换

    update `cr_article` set `img`=replace(`img`,'http://192.168.2.10/upload','http://zouke1220.oss-cn-be ...

  6. SQL查询效率注意事项 2011.12.27

    一.查询条件精确,针对有参数传入情况 二.SQL逻辑执行顺序 FROM-->JOIN-->WHERE-->GROUP-->HAVING-->DISTINCT-->O ...

  7. kali apt update 错误——下列签名无效: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository

    这是因为key过期了 wget -q -O - https://archive.kali.org/archive-key.asc | apt-key add apt update

  8. c++中的Exceptions异常处理(翁恺c++公开课[36])

    Exceptions用于处理Run-time Error: //文件读取的异常捕获伪代码 try{ open the file; determine its size; allocate that m ...

  9. 用C/C++创建windows服务程序

    转载:https://blog.csdn.net/chenyujing1234/article/details/8023816 一.演示过程下方代码演示了如何使用vs(C/C++)创建windows服 ...

  10. LSTM算法公式

    参考:<基于强化学习的开放领域聊天机器人对话生成算法>