<?php
namespace app\wechatapi\controller;
use app\BaseController;
use think\facade\Db;
use think\facade\Request;

class Company extends BaseController
{

    //公司详情
    public function companyDetail()
    {
        $where['company_id'] =1;
        $data = Db::name('company')->where($where)->find();
        return $this->returnJson($data);
    }


    //获取导航栏的相对于的文字内容
    public function getWord()
    {
        $nav_id = Request::param('nav_id');
        $where['nav_id'] = $nav_id;
        $res = Db::name('web_word')->where($where)->find();
        $result = json_decode($res['content'],true);
        return $this->returnJson($result);
    }

    //导航栏列表
    public function navList()
    {
        $where['web_id']  = Request::param('web_id',1);
        $data = Db::name('web_nav')->where($where)->order(['sort'=>'desc','nav_id'=>'asc'])->select()->toArray();
        return $this->returnJson($data);
    }


}
