<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

class SupplierShareApplyModel extends Model
{
    protected $connection='web';
    protected $table='supplier_share_apply';
    public $timestamps = false;

    //通过
    const STATUS_PASS = 2;
    //待复审
    const STATUS_NEED_REVIEW = 1;
    //待提审
    const STATUS_PENDING = 0;
    //审核不通过
    const STATUS_AUDIT_REJECT = -1;
    //复审不通过
    const STATUS_REVIEW_REJECT = -2;


    public function supplier()
    {
        return $this->hasOne(SupplierChannelModel::class, 'supplier_id', 'supplier_id');
    }

    public function department()
    {
        return $this->hasOne(DepartmentModel::class, 'department_id', 'department_id');
    }

    //申请的部门信息
    public function apply_department()
    {
        return $this->hasOne(DepartmentModel::class, 'department_id', 'apply_department_id');
    }

    public function apply_user()
    {
        return $this->hasOne(UserInfoModel::class, 'userId', 'create_uid');
    }

}