41 lines
814 B
PHP
41 lines
814 B
PHP
<?php
|
|
|
|
namespace app\admin\controller;
|
|
|
|
use app\common\controller\Backend;
|
|
use app\admin\model\Express as ExpressModel;
|
|
|
|
/**
|
|
* 快递公司管理
|
|
*/
|
|
class Express extends Backend
|
|
{
|
|
|
|
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();
|
|
|
|
if (is_array($list)) {
|
|
$result = array("total" => count($list), "rows" => $list);
|
|
} else {
|
|
$result = array("total" => count($list), "rows" => $list->toArray());
|
|
}
|
|
|
|
return $this->success("获取成功", $result);
|
|
}
|
|
}
|