php 实现店铺装修5
/**
* @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的更多相关文章
- 关于淘宝店铺装修弹出层popup的记录
小龙最近做了一下下淘宝的店铺装修,里面封装的widget深不见底,刚刚整明白popup,也就是弹出层的使用方法,大神勿喷: <div class="area001">触 ...
- Adobe Photoshop CC2018最新教程+某宝店铺装修教程
PS免费教程,ps淘宝店铺装修教程.该资源为本人从某商网站重金买来,现免费分享给大家,下载地址:百度网盘,https://pan.baidu.com/s/127PjFbGwVVUVce1litHFsw
- php 实现店铺装修6
/** * @title 获取预览或发布的蜂店模板样式 * @param store_id 是 string 店铺id * @param type 是 int 装修模板的状态:1-预览蜂店装修模板样式 ...
- php 实现店铺装修7
type_id=0的情况 type_id=1的情况 type_id=2的情况 /** * @title 店铺装修--商品分类 * @param type ...
- php 实现店铺装修8
/** * @title 店铺装修--根据分类获取商品列表 * @param source 是 int 来源(1--h5.2--app) * @param type 是 string 店铺类型--首页 ...
- php 实现店铺装修3
/** * @title 装修店铺 * @param plate_id 是 int 店铺装修样式ID * @param type 是 int 模板样式子板块类型(4-海景.6-二宫格.8-三宫格.9- ...
- php 实现店铺装修2
<?php namespace Webapp\Model; use Common\Model\DataModel\FlagShopCategoryModel; use Common\Model\ ...
- php 实现店铺装修1
一.原型分析 1.店铺未装修的情况下,使用默认样式,哪个是默认样式由后台告知: 2.所有的样式由后台进行维护(但后台始终有一个默认样式,不可删除不可编辑),所有样式,只要用户未编辑过,则默认按照商品的 ...
- php 实现店铺装修4
/** * @title 发布装修的店铺 * @example FlagShipShopDecorate.fabu? 调试参数:{"username":"17721355 ...
随机推荐
- openfire 安装配置时出现The Openfire database schema does not appear to be installed. Follow the installati错误的解决方案
最近再弄openfire用openLDAP整合,本来没整合的时候选的标准数据库没问题,但是现在用嵌入式数据库,就报错了,,, 报错原因:没有导入openfire的数据表 解放办法: 1.登陆数据库 , ...
- spring boot 配置时区差别
前提 数据库时区:GMT+8 show variables like '%time_zone%'; 本机电脑时区: 情景一.不指定时区 传递的参数映射到Data不指定时区,连接数据库不指定时区,保存时 ...
- Python学习第二十二课——Mysql 表记录的一些基本操作 (增删改)
记录基本操作: 增:(insert into) 基本语法: insert into 表名(字段) values(对应字段的值): 例子1: insert into employee(id,name,a ...
- 全排列next_permutation()用法和构造函数赋值
全排列next_permutation()用法 在头文件aglorithm里 就是1~n数组的现在的字典序到最大的字典序的依次增加.(最多可以是n!种情况) int a[n]; do{ }while( ...
- mcast_join_source_group函数
#include <errno.h> #include <net/if.h> #include <sys/socket.h> #define SA struct s ...
- 设计模式课程 设计模式精讲 4-2 简单工厂coding
1 代码演练 1.1 未使用简单工厂模式代码 1.2 使用简单工厂模式 1.3 使用反射机制简单工行模式 1 代码演练 1.1 未使用简单工厂模式代码 测试类: package com.geely.d ...
- Python Tkinter学习笔记
介绍 入门实例 显示一个窗口,窗口里面有一个标签,显示文字 import tkinter as tk # 一个顶层窗口的实例(Top Level),也称为根窗口 app = tk.Tk() # 设置窗 ...
- C++:面向对象的相关概念
对象: 一般意义上的对象:是现实世界中一个实际存在的事物 面向对象方法中的对象:是系统中用来描述客观事物的一个实体 抽象与分类: 分类所依据的原则:抽象 抽象出同一类对象的共同属性和行为,形成类 类与 ...
- 什么是 SDK?
通俗而言: 1.其实很简单,SDK 就是 Software Development Kit 的缩写,中问意思是: 软件开发工具包. 2.这是一个覆盖面相当广泛的名词,可以这么说: 辅助开发某一类软件的 ...
- SQL SERVER 语法汇总
一.基础 1.说明:创建数据库CREATE DATABASE database-name 2.说明:删除数据库drop database dbname3.说明:备份sql server--- 创建 备 ...