API 说明
- http://IP/weather/100100001 根据 citycode 获取城市天气信息(JSON 格式)
返回:{“code”:200,“weather_info”:“sunny”}
code 200表示请求正确,code 404表示请求错误
<?php
namespace app\api\model;
use think\Model;
use think\Db;
// http://IP/weather/100100001 根据 citycode 获取城市天气信息(JSON 格式)
class Weather extends Model
{
public function getWeather($citycode = '101010100') // default code Beijing
{
$res = Db: