| 123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace app\api\controller;
- use app\common\controller\Api;
- use \think\Request;
- use \think\Db;
- /**
- * 客户管理接口
- */
- class Custom extends Api
- {
- protected $noNeedLogin = ['*'];
- protected $noNeedRight = ['*'];
- /**
- * 首页
- *
- */
- public function index()
- {
- $this->success('请求成功');
- }
- /**
- * 获取客户信息
- *
- * @ApiMethod GET
- *
- */
- public function getCustom(){
- if (Request::instance()->isGet() == false){
- $this->error('非法请求');
- }
- $field = 'rtrim(客户编号) as 客户编号,rtrim(客户名称) as 客户名称';
- $list = Db::name('产品_基本资料')->distinct(true)->field($field)->order('客户编号 asc')->select();
- $this->success('请求成功',$list);
- }
- }
|