예제 #1
0
 static function del_one($id = null, $kind = null, $upid = null, $author = null, $where = null)
 {
     if (!$author) {
         $author = data_use::get_usr('userid');
         if (!$author) {
             die("请登录后重试!");
         }
         $where = $where . " and " . self::$data_columns[author] . "=" . $author;
         //只能修改自己的
     }
     $columns = self::$data_columns[content];
     if ($id) {
         $where_plus = " and " . self::$data_id . "=" . $id;
     }
     if ($kind && $upid) {
         $where_plus = " and " . self::$data_columns[upid] . "=" . $upid . " and " . self::$data_columns[kind] . "='" . $kind . "'";
     }
     if ($where_plus) {
         $where = $where . $where_plus;
     }
     sql_use::update_nowtime(self::$data_table, self::$data_columns[changetime], $where);
     $result = sql_use::update_delone(self::$data_table, $columns, $where);
     return $result;
 }
예제 #2
0
 static function update_delone($where, $columns = null, $author = NULL)
 {
     if (!$author) {
         $author = data_use::get_usr('userid');
         if (!$author) {
             return false;
         }
     }
     if (!$columns) {
         $columns = self::$data_columns[content];
     }
     if (is_numeric($where)) {
         //如果where是数字的话则找id是这个数字的加一
         $chid = self::$data_id . "=" . $where;
         $where = $chid;
     } else {
         $chid = 0;
     }
     //            $where= $where." and ".self::$data_columns[author]."=".$author;    只能修改自己的
     sql_use::update_nowtime(self::$data_table, self::$data_columns[changetime], $where);
     $result = sql_use::update_delone(self::$data_table, $columns, $where);
     self::collect($chid, 0, 13, $author, $chid . "|change_value=-1");
     //            self::collect($chid, 0, 13, $author, $where."|change_value=-1");
     return $result;
 }