1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace App\Models;
- use App\Traits\ModelHelpers;
- use Illuminate\Database\Eloquent\Model;
- class ApplyParking extends Model
- {
- use ModelHelpers;
- //
- protected $table = 'apply_parkings'; // 申请还车点
- protected $guarded = [];
- const IS_EXAMINE_OK = 1;
- const IS_EXAMINE_NO = 0;
- const IS_EXAMINE_FAILED = 2;
- public static $examineMaps = [
- self::IS_EXAMINE_NO => '未审核',
- self::IS_EXAMINE_OK => '已通过审核',
- self::IS_EXAMINE_FAILED => '未通过审核',
- ];
- public function users(){
- return $this->belongsTo(User::class,'user_id','id');
- }
- public function areas(){
- return $this->belongsTo(Area::class,'area_id','id');
- }
- public function updateExamine($id,$val){
- return self::query()->where('id',$id)->update(['is_examine' => $val]);
- }
- }
|