...
|
...
|
@@ -599,6 +599,107 @@ class UserController extends CommonController |
|
|
|
|
|
|
|
|
/**
|
|
|
* @title 密码找回第一步(sure)
|
|
|
* @description 接口说明
|
|
|
* @author 开发者
|
|
|
* @url /api/portal/User/findPasswordFirst
|
|
|
* @method POST
|
|
|
* @param name:tel type:int require:1 default: other: desc:手机号
|
|
|
* @param name:imgCode type:int require:1 default: other: desc:图片验证码
|
|
|
* @param name:code type:int require:1 default: other: desc:短信验证码
|
|
|
* @param name:connect type:int require:1 default: other:1 登录注册 ,2其他 desc:1
|
|
|
*/
|
|
|
public function findPasswordFirst(Request $request){
|
|
|
$data = $request->param();
|
|
|
if($data){
|
|
|
if(empty($data['tel'])){
|
|
|
$this->apiResponse('0','请输入手机号');
|
|
|
}
|
|
|
if(empty($data['imgCode'])){
|
|
|
$this->apiResponse('0','请输入图片验证码');
|
|
|
}
|
|
|
if(empty($data['code'])){
|
|
|
$this->apiResponse('0','请输入短信验证码');
|
|
|
}
|
|
|
$where_mem['tel'] = $data['tel'];
|
|
|
$where_mem['status'] = array('neq',9);
|
|
|
$is = Db::name('Member')->where($where_mem)->field('id')->find();
|
|
|
if(!$is){
|
|
|
$this->apiResponse('0','该手机号暂未注册');
|
|
|
}
|
|
|
// 验证手机验证码
|
|
|
$where_Code['tel'] = $data['tel'];
|
|
|
$where_Code['type'] = 2;
|
|
|
$code = Db::name('Code')->where($where_Code)->order('create_time desc')->find();
|
|
|
if($code['code'] != $data['code']){
|
|
|
$this->apiResponse('0','短信验证码错误');
|
|
|
}else{
|
|
|
$this->apiResponse('1','成功');
|
|
|
}
|
|
|
|
|
|
}else{
|
|
|
// 返回验证码图片
|
|
|
$img = $this->getImgUrl();
|
|
|
$this->apiResponse('1','成功',$img);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* @title 密码找回第二步(sure)
|
|
|
* @description 接口说明
|
|
|
* @author 开发者
|
|
|
* @url /api/portal/User/findPassword
|
|
|
* @method POST
|
|
|
* @param name:tel type:int require:1 default: other: desc:手机号
|
|
|
* @param name:newPassword type:int require:1 default: other: desc:新密码
|
|
|
* @param name:sureNewPassword type:int require:1 default: other: desc:确认新密码
|
|
|
* @param name:connect type:int require:1 default: other:1 登录注册 ,2其他 desc:1
|
|
|
*/
|
|
|
public function findPasswordNext(Request $request){
|
|
|
$data = $request->param();
|
|
|
if($data){
|
|
|
if(empty($data['tel'])){
|
|
|
$this->apiResponse('0','请输入手机号');
|
|
|
}
|
|
|
if(empty($data['newPassword'])){
|
|
|
$this->apiResponse('0','请输入新密码');
|
|
|
}
|
|
|
if(empty($data['sureNewPassword'])){
|
|
|
$this->apiResponse('0','请输入确认新密码');
|
|
|
}
|
|
|
$where_mem['tel'] = $data['tel'];
|
|
|
$where_mem['status'] = array('neq',9);
|
|
|
$is = Db::name('Member')->where($where_mem)->field('id')->find();
|
|
|
if(!$is){
|
|
|
$this->apiResponse('0','该手机号暂未注册');
|
|
|
}
|
|
|
if($data['newPassword'] == $data['sureNewPassword']){
|
|
|
$where_update['tel'] = $data['tel'];
|
|
|
$middleStr = rand(1000,9999).time().rand(100,999);
|
|
|
$update['token'] = $this->md5($middleStr);
|
|
|
$update['password'] = $this->md5($data['newPassword']);
|
|
|
$is_update = Db::name('Member')->where($where_update)->update($update);
|
|
|
if($is_update){
|
|
|
$this->apiResponse('1','成功',$update['token']);
|
|
|
}else{
|
|
|
$this->apiResponse('0','修改失败');
|
|
|
}
|
|
|
}else{
|
|
|
$this->apiResponse('0','两次密码输入不一致');
|
|
|
}
|
|
|
|
|
|
}else{
|
|
|
// 返回验证码图片
|
|
|
$img = $this->getImgUrl();
|
|
|
$this->apiResponse('1','成功',$img);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* @title 密码找回(sure)
|
|
|
* @description 接口说明
|
|
|
* @author 开发者
|
...
|
...
|
@@ -635,6 +736,7 @@ class UserController extends CommonController |
|
|
if(!$is){
|
|
|
$this->apiResponse('0','该手机号暂未注册');
|
|
|
}
|
|
|
|
|
|
// 验证手机验证码
|
|
|
$where_Code['tel'] = $data['tel'];
|
|
|
$where_Code['type'] = 2;
|
...
|
...
|
@@ -671,6 +773,7 @@ class UserController extends CommonController |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* @title 绑定银行卡(sure)
|
|
|
* @description 接口说明
|
...
|
...
|
@@ -911,7 +1014,7 @@ class UserController extends CommonController |
|
|
$where_comment['need_id'] = $unv['id'];
|
|
|
$where_comment['user_id'] = $unv['user_id'];
|
|
|
$where_comment['status'] = 1;
|
|
|
$comment = Db::name('Comment')->where($where_comment)->field('is_comment,create_time')->find();
|
|
|
$comment = Db::name('Comment')->where($where_comment)->field('is_comment,create_time,content')->find();
|
|
|
if($comment){
|
|
|
// 判断是否超过30天
|
|
|
if(time() > ($comment['create_time'] + 2592000)){
|
...
|
...
|
@@ -923,6 +1026,7 @@ class UserController extends CommonController |
|
|
$user_need[$unk]['comment'] = 1;
|
|
|
}
|
|
|
}
|
|
|
$user_need[$unk]['comment_content'] = $comment['content'];
|
|
|
}else{
|
|
|
$user_need[$unk]['comment'] = 2;
|
|
|
}
|
...
|
...
|
@@ -1029,7 +1133,7 @@ class UserController extends CommonController |
|
|
->where($where_agency)
|
|
|
->join("hp_Member m", 'm.id = a.agency_id')
|
|
|
->field('a.*,a.id as intermediary_id,
|
|
|
m.id as user_id,m.name,m.company,m.store,m.tel,m.reputation,m.start')
|
|
|
m.id as user_id,m.name,m.company,m.pic,m.store,m.tel,m.reputation,m.start')
|
|
|
->select()->toArray();
|
|
|
if($agency){
|
|
|
foreach ($agency as $agek=>$agev){
|
...
|
...
|
@@ -1040,6 +1144,9 @@ class UserController extends CommonController |
|
|
$agency[$agek]['deed_tax'] = $this->getStr($agev['deed_tax']);
|
|
|
$agency[$agek]['personal_income_tax'] = $this->getStr($agev['personal_income_tax']);
|
|
|
$agency[$agek]['else_tax'] = $this->getStr($agev['else_tax']);
|
|
|
if(!empty($agev['pic'])) {
|
|
|
$agency[$agek]['pic'] = cmf_get_asset_url($agev['pic']);
|
|
|
}
|
|
|
}
|
|
|
$final['agency'] = $agency;
|
|
|
$this->apiResponse('1','成功',$final);
|
...
|
...
|
@@ -1318,7 +1425,7 @@ class UserController extends CommonController |
|
|
$find = Db::name('UserNeed')->alias('n')
|
|
|
->where($where_find)
|
|
|
->join("Agency a",'a.need_id = n.id')
|
|
|
->field("a.id as intermediary_id")
|
|
|
->field("a.agency_id,a.id as intermediary_id")
|
|
|
->find();
|
|
|
if($find){
|
|
|
$where_first['id'] = $data['need_id'];
|
...
|
...
|
@@ -1377,8 +1484,17 @@ class UserController extends CommonController |
|
|
public function getMoney(Request $request){
|
|
|
Db::startTrans();
|
|
|
$data = $request->param();
|
|
|
|
|
|
$where_member['token'] = $data['token'];
|
|
|
$member = Db::name('Member')->where($where_member)->field('id,money,type')->find();
|
|
|
$where_card['user_id'] = $member['id'];
|
|
|
$where_card['status'] = 1;
|
|
|
$card = Db::name('Card')->where($where_card)->find();
|
|
|
if(!$card){
|
|
|
$this->apiResponse('0','请先绑定银行卡');
|
|
|
}else{
|
|
|
$final['card'] = $card;
|
|
|
}
|
|
|
if($member['money'] <= 0){
|
|
|
$this->apiResponse('0','用户余额不足');
|
|
|
}
|
...
|
...
|
@@ -1388,14 +1504,7 @@ class UserController extends CommonController |
|
|
Db::rollback();
|
|
|
$this->apiResponse('0','用户信息错误');
|
|
|
}
|
|
|
$where_card['user_id'] = $member['id'];
|
|
|
$where_card['status'] = 1;
|
|
|
$card = Db::name('Card')->where($where_card)->find();
|
|
|
if(!$card){
|
|
|
$this->apiResponse('0','请先绑定银行卡');
|
|
|
}else{
|
|
|
$final['card'] = $card;
|
|
|
}
|
|
|
|
|
|
$where_umoney['user_id'] = $member['id'];
|
|
|
$where_umoney['user_type'] = $member['type'];
|
|
|
// if($member['type'] == 1){
|
...
|
...
|
@@ -1446,9 +1555,15 @@ class UserController extends CommonController |
|
|
->join('Bank b','b.id=c.bank_id')
|
|
|
->where($where_card)
|
|
|
->field('b.name,c.card_num')->find();
|
|
|
if(!$card){
|
|
|
$final['is_getmoney'] = 0;
|
|
|
}else{
|
|
|
$final['is_getmoney'] = 1;
|
|
|
}
|
|
|
$final['card'] = $card;
|
|
|
$where_umoney['user_id'] = $user['id'];
|
|
|
$where_umoney['status'] = array('neq',9);
|
|
|
$where_umoney['order_type'] = array('in','6,7');
|
|
|
$order_list = Db::name('MoneyDetail')->where($where_umoney)->field('id,title,money,update_time,type')->select()->toArray();
|
|
|
$final['user'] = $user;
|
|
|
if($order_list){
|
...
|
...
|
|