public function getUserByProjectId($projectId) { $mysql = new Mysql(); $sql = "SELECT GROUP_CONCAT(DISTINCT result.UserId) as Ids ,GROUP_CONCAT(DISTINCT result.name) as Names FROM (SELECT d.UserId,u.Name FROM " . $mysql->dbpre . "developer" . $mysql->debug . " as d ," . $mysql->dbpre . "user" . $mysql->debug . " as u WHERE d.UserId=u.UserId and ProjectId=" . intval($projectId) . " ) as result"; //echo $sql; $result = $mysql->getLine($sql); $mysql->closeDb(); return $result; }
public function getModel($id) { $mysql = new Mysql(); $sql = "SELECT * FROM " . $mysql->dbpre . "project" . $mysql->debug . " WHERE Id=" . intval($id); // var_dump( $sql ); // exit; $result = $mysql->getLine($sql); $mysql->closeDb(); return $result; }
function setValue($id) { $mysql = new Mysql(); $sqlformat = "select Id,Name,NameUrl,Description,ChildCount,Status,DisplayOrder,ParentId,Property,Image,Belong from %scategory%s where id=%d and belong=%d"; $sql = sprintf($sqlformat, $mysql->dbpre, $mysql->debug, intval($id), intval($this->Belong)); $row = $mysql->getLine($sql); $mysql->closeDb(); $this->Id = $row['Id']; $this->Name = $row['Name']; $this->NameUrl = $row['NameUrl']; $this->ParentId = $row['ParentId']; $this->Property = $row['Property']; $this->Status = $row['Status']; $this->DisplayOrder = $row['DisplayOrder']; $this->Description = $row['Description']; $this->Image = $row['Image']; $this->Belong = $row['Belong']; }
function getPost($id, $status) { $mysql = new Mysql(); $sql = "SELECT Id,ChildIds,Belong,Subject,Content,CategoryRoot,Status,DisplayOrder,CategoryIds,CommentStatus,CommentCount,Image,Creator,CreateDate,Tags,DigCount,ViewCount,Summary, CreatorDetail,Property,Source,Link,DisplayDate,Memo,Keywords from " . $mysql->dbpre . "post" . $mysql->debug . " where id=" . intval($id) . " and belong=" . intval($this->Belong); if ($status != -1) { $sql .= " and Status = " . intval($status); } $row = $mysql->getLine($sql); $mysql->closeDb(); return $row; }
public function getUserByLevel($deptId, $level) { $mysql = new Mysql(); $sql = "SELECT * FROM " . $mysql->dbpre . "user" . $mysql->debug . " WHERE Level=" . intval($level) . " AND Department=" . intval($deptId) . " LIMIT 1"; // var_dump( $sql ); // exit; $result = $mysql->getLine($sql); $mysql->closeDb(); return $result; }