select()->toArray(); } catch (Exception $e) { return ['error'=>$e->getMessage()]; } } /** * @Notes: 气泡详细 * @Author: 张无忌 * @param $id * @return array */ public static function detail($id) { $footprintModel = new Footprint(); return $footprintModel->findOrEmpty((int)$id)->toArray(); } /** * @Notes: 编辑足迹气泡 * @Author: 张无忌 * @param $post * @return bool */ public static function edit($post) { try { $footprintModel = new Footprint(); $footprintModel->where(['id' => (int)$post['id']]) ->update(['status' => $post['status']]); return true; } catch (Exception $e) { static::$error = $e->getMessage(); return false; } } /** * @Notes: 足迹设置 * @Author: 张无忌 * @param $post * @return bool */ public static function set($post) { try { ConfigServer::set('footprint', 'footprint_duration', $post['duration']); ConfigServer::set('footprint', 'footprint_status', $post['status']); return true; } catch (Exception $e) { return false; } } }