public function del() { $id = I('id', NULL); if (!empty($id)) { $model = new LinkModel(); if (is_array($id)) { $where = 'id in (' . implode(',', $id) . ')'; } else { $where = 'id = ' . $id; $link = $model->where('id=' . $id)->find(); if ($link['is_sys'] == 1) { $this->message('系统内置,删除失败!', __URL__ . '/index'); } } if (false !== $model->where($where)->delete()) { $this->message('删除成功', __URL__ . '/index'); } else { $this->message('删除失败:' . $model->getError(), __URL__ . '/index'); } } else { $this->message('请选择删除对象', __URL__ . '/index'); } }
/** * 底部链接:type_id==3 */ public static function footers() { return LinkModel::where('cid', 0)->where('type_id', 3)->orderBy('sort', 'desc')->paginate(10); }