1234567891011121314151617181920212223242526272829 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\SoftDeletes;
- use Illuminate\Database\Eloquent\Model;
- class UserW extends Model{
- use SoftDeletes;
- protected $connection = 'mysql_w';
- protected $table='user';
- protected $guarded=[];
- public function order()
- {
- return $this->hasMany(OrderW::class,'user_id');
- }
- public function scan()
- {
- return $this->hasMany(Scan::class,'user_id');
- }
- public function recom()
- {
- return $this->hasOne(UserW::class,'id','recomer_id');
- }
- }
|