123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Administrator
- * Date: 2019/4/30
- * Time: 13:48
- */
- namespace App\Http\Middleware;
- use App\Models\Tpl;
- use App\Repositories\MemberSetmealRepository;
- use App\Repositories\PmsRepository;
- use Closure;
- use Illuminate\Support\Facades\View;
- class companyInfoAuth
- {
- protected $memberSetmealRepositorywhere;
- /**
- * companyInfoAuth constructor.
- * @param $memberSetmealRepositorywhere
- */
- public function __construct(MemberSetmealRepository $memberSetmealRepository)
- {
- $this->memberSetmealRepository = $memberSetmealRepository;
- }
- public function handle($request, Closure $next)
- {
- $template = false;
- $companyInfo = auth('web-company')->user();
- if (!$companyInfo->nature || !$companyInfo->scale || !$companyInfo->organization_code || !$companyInfo->district || !$companyInfo->trade || !$companyInfo->contents) {
- return redirect()->route('com.info')->with('message', "请完善企业基本信息后,再进行其他操作");
- }
- $tpl = Tpl::where(['tpl_type'=>1,'display'=>1])->get();
- if(!$tpl->isEmpty()){
- $template = true;
- }
- $GLOBALS['template'] = $tpl;
- View::share('template', $template);
- return $next($request);
- }
- }
|