| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- namespace app\api\model\dealer;
- use app\common\model\dealer\Capital as CapitalModel;
- /**
- * 分销商资金明细模型
- * Class Apply
- * @package app\api\model\dealer
- */
- class Capital extends CapitalModel
- {
- /**
- * 隐藏字段
- * @var array
- */
- protected $hidden = [
- 'create_time',
- 'update_time',
- ];
- protected $types = [
- 1=>'佣金结算',
- 2=>'平级佣金',
- 3=>'推荐佣金',
- 4=>'直推订单佣金',
- 5=>'间推订单佣金',
- 99=>'其他',
- ];
- /**
- * 获取分销商提现明细
- * @param $user_id
- * @param int $apply_status
- * @return \think\Paginator
- * @throws \think\exception\DbException
- */
- public function getList($user_id, $apply_status = -1)
- {
- $types = $this->types;
- $this->where('user_id', '=', $user_id);
- $apply_status > -1 && $this->where('status', '=', $apply_status);
- return $this->order(['create_time' => 'desc'])
- ->paginate(15, false, [
- 'query' => \request()->request()
- ])->each(function($item, $k) use($types){
- $item['type_name'] = isset($types[$item['type']])? $types[$item['type']] : '未知';
- });
- }
- }
|