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

class Company extends Base
{
    protected $middleware = ['app\middleware\CheckValidata::class'];

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

    //编辑公司信息
    public function companyEdit(){
        $where['company_id'] =1;
        $data['company_name'] = Request::param('company_name');
        $data['province_id'] = Request::param('province_id');
        $data['city_id'] = Request::param('city_id');
        $data['area_id'] = Request::param('area_id');
        $data['province_name'] = Request::param('province_name');
        $data['city_name'] = Request::param('city_name');
        $data['area_name'] = Request::param('area_name');
        $data['address'] = Request::param('address');
        $data['phone'] = Request::param('phone');
        $res = Db::name('company')->where($where)->update($data);
        return $this->returnJson([],'修改成功!');
    }




}