where('is_enabled', 1); // 查询sandbox应用 if (isset($where['is_sandbox']) && in_array($where['is_sandbox'], [0, 1])) { $query->where('is_sandbox', $where['is_sandbox']); } // limit查询长度 if ($limit) { $query->limit($limit); } $result = $query->get(); return $result ? $result->toArray() : []; } /** * 获取小程序信息 * * @param $appId * @return array */ public function getMiniAppByAppId($appId): array { if (empty($appId)) { return []; } $result = OfficialAccount::where('app_id', $appId)->first(); return $result ? $result->toArray() : []; } /** * @param $where * @param $data * @return false */ public function updateMiniApp($where, $data): bool { if (empty($where) || empty($data)) { return false; } return OfficialAccount::where($where)->update($data); } }