12345678910111213141516171819202122232425 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- // use Illuminate\Database\Eloquent\SoftDeletes;
- class Rewards extends Model
- {
- // use SoftDeletes;
- //定义表
- protected $table = "rewards";
- //定义主键
- protected $primaryKey = "id";
- protected $fillable = ['agent_id','recom_id','store_id','type','bonus','spec','totalprice','goods_id','goods_price','goods_num','month'];
- public function agent()
- {
- return $this->belongsTo('App\Models\User','agent_id');
- }
- public function recom()
- {
- return $this->belongsTo('App\Models\User','recom_id');
- }
- }
|