wang hou sheng 8 months ago
parent cd1452004d
commit be233e09b4
  1. 33
      app/api/controller/Invite.php
  2. 1
      app/api/controller/Wholesaler.php
  3. 2
      app/common/model/wholesaler/Apply.php

@ -78,4 +78,37 @@ class Invite extends Controller
$data = compact('refuse_num', 'adoption_num', 'money');
return $this->renderSuccess($data);
}
/**
* @notes:邀请采购商列表
* @return Json
* @throws BaseException
* @throws DbException
* @author: wanghousheng
*/
public function inviteWholesalerList(): Json
{
$data['list'] = [];
$data['total'] = 0;
$model = new InviteLog();
$user_ids = $model->inviteeUserIds();
$status = intval($this->request->post('status', 10));
if ($user_ids) {
$applyModel = new Apply();
$list = $applyModel->whereIn('user_id', $user_ids)
->with(['avatarImg'])
->where(['status' => $status])
->field(['username', 'mobile', 'avatar_id', 'create_time'])
->order('id desc')
->paginate(15);
$data['list'] = $list->items();
if (!empty($data['list'])) {
foreach ($data['list'] as &$item) {
$item['create_time'] = date('Y-m-d H:i:s', $item['create_time']);
}
}
$data['total'] = $list->total();
}
return $this->renderSuccess($data);
}
}

@ -234,5 +234,4 @@ class Wholesaler extends Controller
}
return $this->renderError('操作失败');
}
}

@ -73,7 +73,7 @@ class Apply extends BaseModel
}
/**
* 头照片
* 头照片
* @return HasOne
*/
public function avatarImg(): HasOne

Loading…
Cancel
Save