Swoole\Model::del PHP Метод

del() публичный Метод

删除一条数据主键为$id的记录,
public del ( $id, $where = null ) : true/false
$id
$where string 指定匹配字段,默认为主键
Результат true/false
    public function del($id, $where = null)
    {
        if ($where == null) {
            $where = $this->primary;
        }
        return $this->db->delete($id, $this->table, $where);
    }

Usage Example

Пример #1
0
 private function _filter_expire($rs)
 {
     if ($rs['expire'] != 0 and $rs['expire'] < time()) {
         $this->model->del($rs['id']);
         return false;
     } else {
         return $rs['cvalue'];
     }
 }