UserZ.php 571 B

123456789101112131415161718
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class UserZ extends Model
  5. {
  6. protected $connection = 'mysql_z';
  7. protected $table='user';
  8. protected $fillable = ['openid','unionid','phone','name','nickname','wechat','avatar','integral','level_name','up_phone','last_time',
  9. 'status','bonus','up_name','rank','rank_end','integral_send','total','money','war_names','province','city','area','township',
  10. 'challenge_num','accept_num'];
  11. public function user(){
  12. return $this->hasOne(User::class,'mobile','phone');
  13. }
  14. }