<?php

namespace app\index\controller;

use app\BaseController;
use app\common\command\AddAgreementPdf;
use app\common\model\master_worker\MasterWorkerAgree;
use app\common\service\JsonService;
use think\facade\View;

class AgreementController extends BaseController
{
    //
    public function index()
    {
        $code = $this->request->param('code');
        if(empty($code)){
            return JsonService::fail('code不存在');
        }
        $agree = MasterWorkerAgree::with('master_worker_info')->where('code', $code)->findOrEmpty();
        $agree['sign'] = $this->request->domain().'/'.$agree['sign'];
        View::assign([
            'agree'  => $agree,
        ]);
        return view('master_service');
    }
}
