60 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			60 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
namespace app\api\controller\school;
 | 
						|
 | 
						|
use app\common\model\dyqc\ManystoreShop;
 | 
						|
 | 
						|
/**
 | 
						|
 * 机构接口
 | 
						|
 */
 | 
						|
class Shop extends Base
 | 
						|
{
 | 
						|
    protected $noNeedLogin = ["detail",'people','spec'];
 | 
						|
    protected $noNeedRight = '*';
 | 
						|
 | 
						|
    protected $model = null;
 | 
						|
 | 
						|
    /**
 | 
						|
     * 初始化操作
 | 
						|
     * @access protected
 | 
						|
     */
 | 
						|
    protected function _initialize()
 | 
						|
    {
 | 
						|
 | 
						|
        $this->model = new ManystoreShop;
 | 
						|
        parent::_initialize();
 | 
						|
 | 
						|
        //判断登录用户是否是员工
 | 
						|
    }
 | 
						|
 | 
						|
 | 
						|
    /**
 | 
						|
     * @ApiTitle( 机构详情)
 | 
						|
     * @ApiSummary(机构详情)
 | 
						|
     * @ApiRoute(/api/school/shop/detail)
 | 
						|
     * @ApiMethod(GET)
 | 
						|
     * @ApiParams(name = "id", type = "int",required=true,description = "机构id")
 | 
						|
     * @ApiReturn({
 | 
						|
 | 
						|
     *
 | 
						|
     *})
 | 
						|
     */
 | 
						|
    public function detail(){
 | 
						|
        $id = $this->request->get('id/d','');
 | 
						|
 | 
						|
        if(empty($id)){
 | 
						|
            $this->error(__('缺少必要参数'));
 | 
						|
        }
 | 
						|
 | 
						|
        try {
 | 
						|
            $res =  $this->model->detail($id);
 | 
						|
        } catch (\Exception $e){
 | 
						|
//            Log::log($e->getMessage());
 | 
						|
            $this->error($e->getMessage(),['errcode'=>$e->getCode()]);
 | 
						|
        }
 | 
						|
        $this->success('获取成功', ['detail' => $res]);
 | 
						|
    }
 | 
						|
 | 
						|
 | 
						|
 | 
						|
} |