Apply.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class Apply extends Model{
  5. protected $connection = 'mysql_w';
  6. protected $table='apply';
  7. protected $fillable=['contact_name','contact_phone','contact_id_card','store_id','store_name','store_url','id_card_copy',
  8. 'id_card_national','id_card_name','id_card_number','id_card_valid_time_begin','id_card_valid_time','applyment_id','out_request_no',
  9. 'account_name','account_bank','bank_address_code','bank_branch_id','bank_name','account_number'];
  10. protected $guarded=[];
  11. public function user(){
  12. return $this->belongsTo(User::class,'user_id');
  13. }
  14. //测试
  15. // public function getNameAttribute($value){
  16. // return '【 '.$value.' 】';
  17. // }
  18. //
  19. // protected $appends = ['info'];
  20. //
  21. // public function getInfoAttribute()
  22. // {
  23. // return $this->user_id.'-'.$this->name.'-'.$this->attributes['name'];
  24. // }
  25. //
  26. // public function setNameAttribute($value)
  27. // {
  28. // $this->attributes['name']='【'.$value.'】';
  29. // }
  30. }