You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.0 KiB
52 lines
1.0 KiB
<?php
|
|
namespace App\Http\Controllers\Api;
|
|
|
|
use App\Http\Controllers\Api\CommonController;
|
|
use Illuminate\Http\Request;
|
|
use App\Common\ReturnData;
|
|
|
|
use App\Http\Model\Region;
|
|
|
|
class RegionController extends CommonController
|
|
{
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
public function regionList(Request $request)
|
|
{
|
|
//参数
|
|
$id = $request->input('id', null);
|
|
if ($id == null)
|
|
{
|
|
return ReturnData::create(ReturnData::PARAMS_ERROR);
|
|
}
|
|
|
|
$res = Region::getList($id);
|
|
if(!$res)
|
|
{
|
|
return ReturnData::create(ReturnData::SYSTEM_FAIL);
|
|
}
|
|
|
|
return ReturnData::create(ReturnData::SUCCESS,$res);
|
|
}
|
|
|
|
public function regionDetail(Request $request)
|
|
{
|
|
//参数
|
|
$id = $request->input('id', null);
|
|
if ($id == null)
|
|
{
|
|
return ReturnData::create(ReturnData::PARAMS_ERROR);
|
|
}
|
|
|
|
$res = Region::getOne($id);
|
|
if(!$res)
|
|
{
|
|
return ReturnData::create(ReturnData::SYSTEM_FAIL);
|
|
}
|
|
|
|
return ReturnData::create(ReturnData::SUCCESS,$res);
|
|
}
|
|
}
|