切换导航条
此项目
正在载入...
登录
root
/
chengxiang
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
王晓刚
6 years ago
提交
8c3a62dcf986b46a5db7cfccb6b5b475d10a1098
1 个父辈
84e856b1
1 个管道 的构建
通过
耗费 2 秒
我的保单
变更
2
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
42 行增加
和
26 行删除
app/index/controller/AgentController.php
simplewind/cmf/controller/WeChatBaseController.php
app/index/controller/AgentController.php
查看文件 @
8c3a62d
...
...
@@ -30,35 +30,27 @@ class AgentController extends WeChatBaseController
}
public
function
index
(){
$user_id
=
cmf_get_current_user_id
();
//判断当前用户是否注册过代理人手机号
$userModel
=
new
UserModel
();
$user
=
$userModel
->
findUserData
(
array
(
'id'
=>
$user_id
));
if
(
$user
[
'type'
]
!=
2
){
//重定向到注册代理人身份页面
$this
->
redirect
(
'agent_register_mobile/index'
);
}
else
{
$collocationModel
=
new
CollocationModel
();
//共有多少保单
$no_collocation_count
=
$collocationModel
->
collocationCount
(
array
(
'agent_phone'
=>
$user
[
'mobile2'
]));
//查询所有保险人
$data
=
$collocationModel
->
insurerData
(
array
(
'agent_phone'
=>
$user
[
'mobile2'
]),
"application"
);
dump
(
$data
);
$this
->
assign
(
array
(
'user'
=>
$user
,
'no_collocation_count'
=>
$no_collocation_count
,
'data'
=>
$data
,
)
);
return
$this
->
fetch
();
}
$user
=
$this
->
isAgent
();
$collocationModel
=
new
CollocationModel
();
//共有多少保单
$no_collocation_count
=
$collocationModel
->
collocationCount
(
array
(
'agent_phone'
=>
$user
[
'mobile2'
]));
//查询所有保险人
$data
=
$collocationModel
->
insurerData
(
array
(
'agent_phone'
=>
$user
[
'mobile2'
]),
"application"
);
dump
(
$data
);
$this
->
assign
(
array
(
'user'
=>
$user
,
'no_collocation_count'
=>
$no_collocation_count
,
'data'
=>
$data
,
)
);
return
$this
->
fetch
();
}
//筛选
public
function
select
(){
$keyword
=
$this
->
request
->
param
(
'keyword'
,
0
);
$user_id
=
cmf_get_current_user_id
();
$userModel
=
new
UserModel
();
$user
=
$userModel
->
findUserData
(
array
(
'id'
=>
$user_id
));
$user
=
$this
->
isAgent
();
$collocationModel
=
new
CollocationModel
();
$data
=
$collocationModel
->
insurerData
(
array
(
'agent_phone'
=>
$user
[
'mobile2'
],
'application'
=>
$keyword
),
"application"
);
$arr
[
'code'
]
=
20000
;
...
...
@@ -70,7 +62,17 @@ class AgentController extends WeChatBaseController
public
function
application_information
(){
$param
=
$this
->
request
->
param
();
$user_id
=
cmf_get_current_user_id
();
$this
->
isAgent
();
$collocationModel
=
new
CollocationModel
();
//获取全部的被保人
$insurer
=
$collocationModel
->
insurerData
(
array
(
'application'
=>
$param
[
'application'
]),
"insurer"
);
dump
(
$insurer
);
}
//获取当前代理人的手机号
public
function
get_agent_mobile
(){
$user_id
=
cmf_get_current_user_id
();
$userModel
=
new
UserModel
();
$user
=
$userModel
->
findUserData
(
array
(
'id'
=>
$user_id
));
return
$user
[
'mobile2'
];
}
}
\ No newline at end of file
...
...
simplewind/cmf/controller/WeChatBaseController.php
查看文件 @
8c3a62d
...
...
@@ -10,7 +10,7 @@
// +----------------------------------------------------------------------
namespace
cmf\controller
;
use
app\
user
\model\UserModel
;
use
app\
index
\model\UserModel
;
use
EasyWeChat\Foundation\Application
;
use
think\Db
;
use
app\admin\model\ThemeModel
;
...
...
@@ -277,5 +277,19 @@ class WeChatBaseController extends BaseController
return
$arr
;
}
}
/**
* 判断当前用户是否注册代理人身份
*/
public
function
isAgent
(){
//判断当前用户是否注册过代理人手机号
$user_id
=
cmf_get_current_user_id
();
$userModel
=
new
UserModel
();
$user
=
$userModel
->
findUserData
(
array
(
'id'
=>
$user_id
));
if
(
$user
[
'type'
]
!=
2
){
//重定向到注册代理人身份页面
$this
->
redirect
(
'agent_register_mobile/index'
);
}
return
$user
;
}
}
\ No newline at end of file
...
...
请
注册
或
登录
后发表评论