Beispiel #1
0
 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);
 }
Beispiel #2
0
 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);
     }
 }
Beispiel #3
0
 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;
 }
Beispiel #4
0
 public function getMomentCount()
 {
     $Dbfactory = DbFactory::getinstance();
     return $Dbfactory->tableCount('Moments');
 }
 public function actionTest()
 {
     $Dbfactory = DbFactory::getinstance();
     $count = $Dbfactory->TableCount('Moments');
     echo $count;
 }
Beispiel #6
0
 public function changeStatus($id, $status)
 {
     $Dbfactory = DbFactory::getinstance();
     $arrUpdate['status'] = $status;
     return $Dbfactory->updateTheDbRecord('Itemdetails', 'ItemDetail_Id', $id, $arrUpdate);
 }
Beispiel #7
0
 /**
  * 获取用户
  * @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;
 }
Beispiel #8
0
 public function updateArticles($id, $arr)
 {
     $Dbfactory = DbFactory::getinstance();
     $Dbfactory->updateTheDbRecord('articles', 'Art_Id', $id, $arr);
 }
Beispiel #9
0
 public function changeStatus($id, $status)
 {
     $Dbfactory = DbFactory::getinstance();
     $arrUpdate['status'] = $status;
     return $Dbfactory->updateTheDbRecord('test_tb', 'id', $id, $arrUpdate);
 }