AbyssalSwamp  ActivaUser
» Guest:  Register | Login | 会员列表

RSS subscription to this AbyssalSwamp  

Previous thread Next thread
     
Title: 智慧农场MVC框架项目搭建  
 
chnzbq





UID 305207
Digest 0
Points 0
Posts
码币MB 0 Code
黄金 0 Catty
钻石 0 Pellet
Permissions 10
Register 2019-5-3
Status offline
智慧农场MVC框架项目搭建

[i=s] 本帖最后由 chnzbq 于 2019-5-3 11:45 编辑 基于我司数字工厂咖啡云2.0--PHP MVC 框架改进,由于此系统为半成品,所以必须进行以下改造。 1. session表 不能为空,可把原数据导进来。 2.postgrelSQL大小写敏感,要加双引号 public function read($sessID){ $sql = 'SELECT session_data AS d FROM "'.$this->table.'" WHERE session_id=\''.$sessID .'\' AND session_time > ' . $this->now . ' LIMIT 1'; $res = $this->con->fetch($sql); if($res){ $data = json_decode($res['d'], true); return serialize($data); } return '';
2019-5-3 11:44#1
View profile  Blog  Send a short message  Top
 
chnzbq





UID 305207
Digest 0
Points 0
Posts
码币MB 0 Code
黄金 0 Catty
钻石 0 Pellet
Permissions 10
Register 2019-5-3
Status offline
智慧农场MVC框架项目搭建

智慧农场MVC框架项目搭建
2019-5-3 11:44#2
View profile  Blog  Send a short message  Top
 
教授222





UID 305192
Digest 0
Points 0
Posts
码币MB 0 Code
黄金 0 Catty
钻石 0 Pellet
Permissions 10
Register 2018-9-6
Status offline
数据库开发内容

Image attachment: mmexport1556855258975.jpg (2019-5-3 11:49, 53.32 K)

2019-5-3 11:49#3
View profile  Blog  Send a short message  Top
 
chnzbq





UID 305207
Digest 0
Points 0
Posts
码币MB 0 Code
黄金 0 Catty
钻石 0 Pellet
Permissions 10
Register 2019-5-3
Status offline
$sql = <<prefix}admin.id,{$this->prefix}admin.name,passwd,role_id,info,{$this->prefix}role.name AS role,auth FROM "{$this->prefix}admin" LEFT JOIN {$this->prefix}role ON {$this->prefix}admin.id={$this->prefix}role.id WHERE {$this->prefix}admin.{$type}='{$input}' LIMIT 1; SQL;
2019-5-3 11:50#4
View profile  Blog  Send a short message  Top
 
chnzbq





UID 305207
Digest 0
Points 0
Posts
码币MB 0 Code
黄金 0 Catty
钻石 0 Pellet
Permissions 10
Register 2019-5-3
Status offline
表名,全部要加双引号: $sql = <<prefix}admin".id,"{$this->prefix}admin".name,passwd,role_id,info,"{$this->prefix}role".name AS role,auth FROM "{$this->prefix}admin" LEFT JOIN "{$this->prefix}role" ON "{$this->prefix}admin".id="{$this->prefix}role".id WHERE "{$this->prefix}admin".{$type}='{$input}' LIMIT 1; SQL;
2019-5-3 11:57#5
View profile  Blog  Send a short message  Top
 
chnzbq





UID 305207
Digest 0
Points 0
Posts
码币MB 0 Code
黄金 0 Catty
钻石 0 Pellet
Permissions 10
Register 2019-5-3
Status offline
[i=s] 本帖最后由 chnzbq 于 2019-5-3 12:03 编辑 遇到表名,要加双引号: "{$this->prefix}device" WHERE user_id={$uid} ORDER BY id ASC; SQL; return $this->db->query($sql); } /* 获取一个设备信息(单个设备) */ public function getOneDevice($id){ $sql = <<"{$this->prefix}device" WHERE id={$id} LIMIT 1; SQL; return $this->db->fetch($sql); } /* 获取设备状态信息 */ public function getStatusByUID($uid){ $sql = <<"{$this->prefix}device" WHERE user_id={$uid}; SQL; return $data = $this->db->query($sql); } /* 手动模式设置设备开关(单个设备)(mode=>1) */ public function setDeviceStatus($id,$uid,$status){ $sql = <<"{$this->prefix}device" SET status={$status} WHERE id={$id} AND user_id={$uid} AND mode=1; SQL; return $this->db->exec($sql); } /* 设置设备模式(自动1、手动2模式)(单个设备) */ public function setDeviceMode($id,$uid,$mode){ $sql = <<prefix}device" SET mode={$mode} WHERE id={$id} AND user_id={$uid}; SQL; return $this->db->exec($sql); } }
2019-5-3 12:02#6
View profile  Blog  Send a short message  Top
 
chnzbq





UID 305207
Digest 0
Points 0
Posts
码币MB 0 Code
黄金 0 Catty
钻石 0 Pellet
Permissions 10
Register 2019-5-3
Status offline
“数据”界面 需前端优化成四个温湿度传感器界面
2019-5-3 14:29#7
View profile  Blog  Send a short message  Top
 
chnzbq





UID 305207
Digest 0
Points 0
Posts
码币MB 0 Code
黄金 0 Catty
钻石 0 Pellet
Permissions 10
Register 2019-5-3
Status offline
“我的”界面更改
2019-5-3 14:32#8
View profile  Blog  Send a short message  Top
     


  Printable version | Recommend to a friend | Subscribe to topic | Favorite topic  


 


All times are GMT+8, and the current time is 2026-1-12 04:44 Clear informations ->sessions/cookies - Contact Us - CAFFZ - ZAKE