...
|
...
|
@@ -64,6 +64,7 @@ class Company extends Api |
|
|
"id": 10, //密卷订单ID
|
|
|
"pay_price": "500.00", //实际支付金额
|
|
|
"people_num": 20, //密卷规格人数(斜杠后数字)
|
|
|
"is_top": "1", //是否顶配:0=否,1=是
|
|
|
"secret": {
|
|
|
"title": "测试密卷",
|
|
|
"do_num": 20
|
...
|
...
|
@@ -86,7 +87,7 @@ class Company extends Api |
|
|
foreach ($list as $v) {
|
|
|
// 当前企业下员工含管理员人数
|
|
|
$v['user_count'] = $user_count + 1;
|
|
|
$v->visible(['id','pay_price','people_num','secret'])->append(['user_count']);
|
|
|
$v->visible(['id','pay_price','people_num','is_top','secret'])->append(['user_count']);
|
|
|
$v->getRelation('secret')->visible(['title']);
|
|
|
}
|
|
|
$this->success('成功',$list);
|
...
|
...
|
@@ -107,6 +108,8 @@ class Company extends Api |
|
|
"data": [{
|
|
|
"id": 9, //密卷订单ID
|
|
|
"pay_price": "50.00", //实际支付金额
|
|
|
"people_num": 20, //限制人数
|
|
|
"is_top": "0", //是否顶配:0=否,1=是
|
|
|
"secret": { //密卷信息
|
|
|
"title": "测试密卷", //密卷标题
|
|
|
"do_num": "" //做过人数
|
...
|
...
|
@@ -128,7 +131,7 @@ class Company extends Api |
|
|
foreach ($list as $v) {
|
|
|
// 当前企业下员工含管理员人数
|
|
|
$v['user_count'] = $user_count + 1;
|
|
|
$v->visible(['id','pay_price','people_num','course'])->append(['user_count']);
|
|
|
$v->visible(['id','pay_price','people_num','is_top','course'])->append(['user_count']);
|
|
|
$v->getRelation('course')->visible(['cover','title']);
|
|
|
}
|
|
|
$this->success('成功',$list);
|
...
|
...
|
@@ -146,32 +149,32 @@ class Company extends Api |
|
|
* @ApiParams (name="page_num", type="inter", required=false, description="每页显示数据个数(默认10)")
|
|
|
*
|
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
|
|
"msg": "成功",
|
|
|
"time": "1600167441",
|
|
|
"code": 1,
|
|
|
"msg": "成功",
|
|
|
"time": "1600511589",
|
|
|
"data": {
|
|
|
"id": 7, //消息ID
|
|
|
"user_id": 16, //用户ID
|
|
|
"title": "这是个消息", //消息标题
|
|
|
"content": "这个消息还不错Q", //消息内容
|
|
|
"is_read": "1", //是否已读:0=否,1=是
|
|
|
"createtime": 1599914736,
|
|
|
"updatetime": 1600167441
|
|
|
"total": 2, //数据总数
|
|
|
"list": [
|
|
|
{
|
|
|
"id": 1, //申请ID
|
|
|
"name": "何先生", //申请人名称
|
|
|
"createtime": "2020.09.12" //申请时间
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function companyUser()
|
|
|
{
|
|
|
$status = $this->request->param('status');
|
|
|
$status = $this->request->param('status','0');
|
|
|
$page = $this->request->param('page', 1, 'intval');
|
|
|
$page_num = $this->request->param('page_num', 10, 'intval');
|
|
|
$data = CompanyUser::with(['user'])
|
|
|
->where('company_id',$this->company_id)
|
|
|
$data = CompanyUser::where('company_id',$this->company_id)
|
|
|
->where('status',$status)
|
|
|
->paginate($page_num,false,['page'=>$page])
|
|
|
->each(function($v){
|
|
|
$v['createtime'] = date('Y.m.d',$v['createtime']);
|
|
|
$v->visible(['id','title','createtime']);
|
|
|
$v->visible(['id','name','createtime']);
|
|
|
})->toArray();
|
|
|
$this->success('成功',['total'=>$data['total'],'list'=>$data['data']]);
|
|
|
}
|
...
|
...
|
@@ -189,15 +192,7 @@ class Company extends Api |
|
|
"code": 1,
|
|
|
"msg": "成功",
|
|
|
"time": "1600167441",
|
|
|
"data": {
|
|
|
"id": 7, //消息ID
|
|
|
"user_id": 16, //用户ID
|
|
|
"title": "这是个消息", //消息标题
|
|
|
"content": "这个消息还不错Q", //消息内容
|
|
|
"is_read": "1", //是否已读:0=否,1=是
|
|
|
"createtime": 1599914736,
|
|
|
"updatetime": 1600167441
|
|
|
}
|
|
|
"data": null
|
|
|
})
|
|
|
*/
|
|
|
public function companyUserAgree()
|
...
|
...
|
@@ -223,15 +218,7 @@ class Company extends Api |
|
|
"code": 1,
|
|
|
"msg": "成功",
|
|
|
"time": "1600167441",
|
|
|
"data": {
|
|
|
"id": 7, //消息ID
|
|
|
"user_id": 16, //用户ID
|
|
|
"title": "这是个消息", //消息标题
|
|
|
"content": "这个消息还不错Q", //消息内容
|
|
|
"is_read": "1", //是否已读:0=否,1=是
|
|
|
"createtime": 1599914736,
|
|
|
"updatetime": 1600167441
|
|
|
}
|
|
|
"data": null
|
|
|
})
|
|
|
*/
|
|
|
public function companyUserRefuse()
|
...
|
...
|
@@ -257,15 +244,7 @@ class Company extends Api |
|
|
"code": 1,
|
|
|
"msg": "成功",
|
|
|
"time": "1600167441",
|
|
|
"data": {
|
|
|
"id": 7, //消息ID
|
|
|
"user_id": 16, //用户ID
|
|
|
"title": "这是个消息", //消息标题
|
|
|
"content": "这个消息还不错Q", //消息内容
|
|
|
"is_read": "1", //是否已读:0=否,1=是
|
|
|
"createtime": 1599914736,
|
|
|
"updatetime": 1600167441
|
|
|
}
|
|
|
"data": null
|
|
|
})
|
|
|
*/
|
|
|
public function companyUserRemove()
|
...
|
...
|
@@ -285,7 +264,6 @@ class Company extends Api |
|
|
* @ApiMethod (POST)
|
|
|
*
|
|
|
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
|
|
|
* @ApiParams (name="company_user_id", type="string", required=false, description="申请ID")
|
|
|
*
|
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
...
|
...
|
@@ -309,7 +287,6 @@ class Company extends Api |
|
|
* @ApiMethod (POST)
|
|
|
*
|
|
|
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
|
|
|
* @ApiParams (name="company_user_id", type="string", required=false, description="申请ID")
|
|
|
*
|
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
...
|
...
|
|