初始化项目:添加后端代码、ThinkPHP框架、前端资源
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller\data;
|
||||
|
||||
use app\common\controller\Api;
|
||||
use app\api\model\data\Express as ExpressModel;
|
||||
|
||||
/**
|
||||
* 快递公司接口
|
||||
*/
|
||||
class Express extends Api
|
||||
{
|
||||
protected $noNeedLogin = ['*'];
|
||||
protected $noNeedRight = ['*'];
|
||||
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = new ExpressModel;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取快递公司列表
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$list = $this->model
|
||||
->order('weigh', 'asc')
|
||||
->order('id', 'asc')
|
||||
->select();
|
||||
|
||||
$result = array("total" => count($list), "rows" => $list->toArray());
|
||||
|
||||
return $this->success("获取成功", $result);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user