public function fileLocation($id) { $Dbfactory = DbFactory::getinstance(); $sql = 'SELECT name,location FROM files WHERE ItemDetail_Id = \'' . $id . '\''; $query = $Dbfactory->doQuery($sql); return $Dbfactory->findAll($query); }
public function insertperson($arr) { $id = Yii::$app->user->identity->XH_ID; $Dbfactory = DbFactory::getinstance(); $userexit = (new Query())->select(['XH_ID'])->from('itempersons')->where(['and', ['Item_Id' => $arr['Item_Id']], ['XH_ID' => $arr['XH_ID']]])->all(); if ($userexit) { return false; } elseif ($id == $arr['XH_ID']) { return false; } else { return $Dbfactory->insertIntoDb('itempersons', $arr); } }
public function deleteTodo($Num, $CreateDate) { $XH_ID = \Yii::$app->user->identity->XH_ID; $sql = 'DELETE FROM OwnTodos WHERE XH_ID = \'' . $XH_ID . '\' AND CreateDate = \'' . $CreateDate . '\' AND Num = ' . $Num; $Dbfactory = DbFactory::getinstance(); $result = $Dbfactory->doquery($sql); return $result; }
public function getMomentCount() { $Dbfactory = DbFactory::getinstance(); return $Dbfactory->tableCount('Moments'); }
public function actionTest() { $Dbfactory = DbFactory::getinstance(); $count = $Dbfactory->TableCount('Moments'); echo $count; }
public function changeStatus($id, $status) { $Dbfactory = DbFactory::getinstance(); $arrUpdate['status'] = $status; return $Dbfactory->updateTheDbRecord('Itemdetails', 'ItemDetail_Id', $id, $arrUpdate); }
/** * 获取用户 * @param $page * @param $number * @return array */ public function getPageUserWithOrder($page, $number) { $front = ($page - 1) * $number; $sql = 'SELECT * FROM user_tb ORDER BY status,Name LIMIT ' . $front . ',' . $number; $Dbfactory = DbFactory::getinstance(); $users = $Dbfactory->findBySql($sql); return $users; }
public function updateArticles($id, $arr) { $Dbfactory = DbFactory::getinstance(); $Dbfactory->updateTheDbRecord('articles', 'Art_Id', $id, $arr); }
public function changeStatus($id, $status) { $Dbfactory = DbFactory::getinstance(); $arrUpdate['status'] = $status; return $Dbfactory->updateTheDbRecord('test_tb', 'id', $id, $arrUpdate); }