12345678910111213141516171819202122232425 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Database\Eloquent\SoftDeletes;
- class Store extends Model
- {
- use SoftDeletes;
- protected $table='store';
- protected $fillable = ['name','type','contents','status','address','man_id','province','city','area','warea_id','size','img','decorate_account'];
- public function agent()
- {
- return $this->belongsToMany('App\Models\User','store_user','store_id','user_id');
- }
- public function manager()
- {
- return $this->hasOne('App\Models\User','id','man_id');
- }
- public function user()
- {
- return $this->belongsTo('App\Models\User','man_id');
- }
- }
|