1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- class Apply extends Model{
- protected $connection = 'mysql_w';
- protected $table='apply';
- protected $fillable=['contact_name','contact_phone','contact_id_card','store_id','store_name','store_url','id_card_copy',
- 'id_card_national','id_card_name','id_card_number','id_card_valid_time','applyment_id','out_request_no',
- 'account_name','account_bank','bank_address_code','bank_branch_id','bank_name','account_number'];
- protected $guarded=[];
- public function user(){
- return $this->belongsTo(User::class,'user_id');
- }
- //测试
- // public function getNameAttribute($value){
- // return '【 '.$value.' 】';
- // }
- //
- // protected $appends = ['info'];
- //
- // public function getInfoAttribute()
- // {
- // return $this->user_id.'-'.$this->name.'-'.$this->attributes['name'];
- // }
- //
- // public function setNameAttribute($value)
- // {
- // $this->attributes['name']='【'.$value.'】';
- // }
- }
|