Address.php 663 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class Address extends Model
  5. {
  6. protected $connection = 'mysql_app';
  7. protected $table = 'address';
  8. public $timestamps=false;
  9. protected $fillable=['provice','city','area','con_name','con_mobile','address','uid'];
  10. protected $hidden=['status'];
  11. public function user()
  12. {
  13. return $this->belongsTo(User::class,'uid');
  14. }
  15. public function users()
  16. {
  17. return $this->belongsTo(User::class,'mobile','mobile');
  18. }
  19. public function get_user(){
  20. return $this->belongsTo(User::class,'mobile','mobile')->whereIn('cert_status',[3,6]);
  21. }
  22. }