/**
* @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. 【渗透测试】MS17-010 "永恒之蓝" 修复方案

    多所院校电脑被勒索,吾等当代大学生怎能坐视不管. --------------------------------------------------------------------------- ...

  2. 21. Regular Expressions--from Apache

    转自: http://jmeter.apache.org/usermanual/regular_expressions.html 21.1 Overview¶ JMeter includes the ...

  3. Python基础语法笔记2

    ------------------------------------------------------------------------------- 常量和Pylint的规范 1.常量:常量 ...

  4. idea修改项目编码

  5. windows破解wifi小技巧

    1,首先使用手机某软件破解wifi,手机连上破解的wifi 2,在手机上打开下面界面 3,在电脑上使用二维码识别小工具扫描二维码 4,得到扫面结果 4,得到扫描结果 WIFI:T:WPA;S:DFZJ ...

  6. git pull 之后怎么找回别覆盖掉的内容

    [半夜吓出冷汗,git这个原理还真得好好学学] 不小心把本地写的东西pull了下,然后,全部覆盖掉了,以为就这样没了. 后面想到有“时光穿梭机”,“历史回滚”,在各大群友的帮助下,终于找回了. git ...

  7. P1029最大公约数和最小公倍数

    P1029最大公约数和最小公倍数 #include <iostream> #include <cmath> #include <algorithm> #define ...

  8. C++ 知识零碎搭建

    全局变量 局部变量 函数不能嵌套定义 C/C++ 变量在将要被使用时定义即可, 不必一开始就声明所有变量 函数的定义与声明的区别 C++常规类型自动类型转换规则 C语言中十六进制和八进制的格式: 二进 ...

  9. 图像分割利用KMeans生成灰度图

    import numpy as np import PIL.Image as image from sklearn.cluster import KMeans def loadData(filePat ...

  10. HashMap源码__resize

    final Node<K,V>[] resize() { //创建一个Node数组用于存放table中的元素, Node<K,V>[] oldTab = table; //获取 ...