| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- // +----------------------------------------------------------------------
- // | LARAVEL8.0 框架 [ LARAVEL ][ RXThinkCMF ]
- // +----------------------------------------------------------------------
- // | 版权所有 2017~2021 LARAVEL研发中心
- // +----------------------------------------------------------------------
- // | 官方网站: http://www.laravel.cn
- // +----------------------------------------------------------------------
- // | Author: laravel开发员 <laravel.qq.com>
- // +----------------------------------------------------------------------
- namespace App\Models;
- /**
- * 订单佣金数据管理-模型
- * @author laravel开发员
- * @since 2020/11/11
- * @package App\Models
- */
- class OrderCommissionModel extends BaseModel
- {
- // 设置数据表
- protected $table = 'orders_commissions';
- /**
- * @return \Illuminate\Database\Eloquent\Relations\HasOne
- */
- public function bonusUser1()
- {
- return $this->hasOne(MemberModel::class,'id','bonus_level1_uid')
- ->where(['mark'=>1])
- ->select(['id','openid','balance','mobile','nickname','status']);
- }
- /**
- * @return \Illuminate\Database\Eloquent\Relations\HasOne
- */
- public function bonusUser2()
- {
- return $this->hasOne(MemberModel::class,'id','bonus_level2_uid')
- ->where(['mark'=>1])
- ->select(['id','openid','balance','mobile','nickname','status']);
- }
- /**
- * @return \Illuminate\Database\Eloquent\Relations\HasOne
- */
- public function user()
- {
- return $this->hasOne(MemberModel::class,'id','user_id')
- ->where(['mark'=>1])
- ->select(['id','openid','balance','mobile','nickname','status']);
- }
- /**
- * @return \Illuminate\Database\Eloquent\Relations\HasOne
- */
- public function store()
- {
- return $this->hasOne(StoreModel::class,'id','store_id')
- ->where(['mark'=>1])
- ->select(['id','user_id','balance','mobile','name','status']);
- }
- }
|