Rewards.php 628 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. // use Illuminate\Database\Eloquent\SoftDeletes;
  5. class Rewards extends Model
  6. {
  7. // use SoftDeletes;
  8. //定义表
  9. protected $table = "rewards";
  10. //定义主键
  11. protected $primaryKey = "id";
  12. protected $fillable = ['agent_id','recom_id','store_id','type','bonus','spec','totalprice','goods_id','goods_price','goods_num','month'];
  13. public function agent()
  14. {
  15. return $this->belongsTo('App\Models\User','agent_id');
  16. }
  17. public function recom()
  18. {
  19. return $this->belongsTo('App\Models\User','recom_id');
  20. }
  21. }