Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
e2080fc8
Commit
e2080fc8
authored
Aug 19, 2019
by
clone
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '0813-v3.3.7' of
https://gitee.com/zwyjjc/tl_estate
into 0813-v3.3.7
parents
a868117b
e509bb09
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
217 additions
and
0 deletions
+217
-0
Broker.php
application/api_broker/controller/Broker.php
+19
-0
Broker.php
application/index/controller/Broker.php
+2
-0
BrokerService.php
application/index/service/BrokerService.php
+38
-0
AAgentBankValidate.php
application/index/validate/AAgentBankValidate.php
+48
-0
AAgentsBank.php
application/model/AAgentsBank.php
+109
-0
route.php
application/route.php
+1
-0
No files found.
application/api_broker/controller/Broker.php
View file @
e2080fc8
...
...
@@ -22,6 +22,7 @@ use app\extra\RedisExt;
use
app\index\service\UserAgentService
;
use
app\index\service\UserService
;
use
app\model\AAgents
;
use
app\model\AAgentsBank
;
use
app\model\ABindingDevice
;
use
app\model\ACollectUser
;
use
app\model\ASite
;
...
...
@@ -1200,7 +1201,24 @@ class Broker extends Basic
}
}
/**
* 我的-工资卡
*
* @return \think\Response
*/
public
function
editBank
()
{
$msg
=
''
;
$code
=
200
;
$s_broker
=
new
\app\index\service\BrokerService
();
$result
=
$s_broker
->
editBank
(
$this
->
params
);
if
(
$result
[
'status'
]
==
'fail'
)
{
$code
=
101
;
$msg
=
$result
[
'msg'
];
}
return
$this
->
response
(
$code
,
$msg
);
}
}
\ No newline at end of file
application/index/controller/Broker.php
View file @
e2080fc8
...
...
@@ -480,6 +480,8 @@ class Broker extends Basic
$data
=
$broker_service
->
saveAgentData
(
$this
->
params
,
$this
->
userId
);
if
(
$data
[
'status'
]
==
'fail'
)
{
$result
[
'code'
]
=
101
;
}
else
{
$broker_service
->
editBank
(
$this
->
params
);
}
$result
[
'msg'
]
=
$data
[
'msg'
];
}
else
{
...
...
application/index/service/BrokerService.php
View file @
e2080fc8
...
...
@@ -12,8 +12,10 @@ namespace app\index\service;
use
app\api_broker\service\CallPhoneService
;
use
app\api_broker\service\PushMessageService
;
use
app\api_broker\service\RedisCacheService
;
use
app\index\validate\AAgentBankValidate
;
use
app\index\validate\AAgentValidate
;
use
app\model\AAgents
;
use
app\model\AAgentsBank
;
use
app\model\AAgentsBlackListImg
;
use
app\model\ABindingDevice
;
use
app\model\ADistrict
;
...
...
@@ -551,4 +553,39 @@ class BrokerService
$result
[
'status'
]
=
'successful'
;
return
$result
;
}
/**
* 工资卡
*
* @param $data
* @return $this|int|string
*/
public
function
editBank
(
$data
)
{
$result
[
'status'
]
=
'fail'
;
$validate
=
new
AAgentBankValidate
();
$m_bank
=
new
AAgentsBank
();
$bank_id
=
$m_bank
->
getFieldOneValue
(
'id'
,
[
'agent_id'
=>
$data
[
'agent_id'
],
'is_del'
=>
0
]);
if
(
$bank_id
)
{
$check
=
$validate
->
scene
(
'edit'
)
->
check
(
$data
);
if
(
!
$check
)
{
$result
[
'msg'
]
=
$validate
->
getError
();
return
$result
;
}
$result
=
$m_bank
->
updateData
(
$data
,
[
'id'
=>
$bank_id
]);
}
else
{
$check
=
$validate
->
scene
(
'add'
)
->
check
(
$data
);
if
(
!
$check
)
{
$result
[
'msg'
]
=
$validate
->
getError
();
return
$result
;
}
$result
=
$m_bank
->
insertData
(
$data
);
}
if
(
$result
)
{
$result
[
'status'
]
=
'successful'
;
}
return
$result
;
}
}
\ No newline at end of file
application/index/validate/AAgentBankValidate.php
0 → 100644
View file @
e2080fc8
<?php
/**
* Created by PhpStorm.
* User: 43897
* Date: 2018/10/17
* Time: 14:50
*/
namespace
app\index\validate
;
use
think\Validate
;
class
AAgentBankValidate
extends
Validate
{
protected
$rule
=
[
'id'
=>
'require|between:1,9999999999'
,
'agent_id'
=>
'require|between:1,9999999999'
,
'account'
=>
'require|length:1,80'
,
'bank'
=>
'require|length:1,255'
,
'card_no'
=>
'require|length:1,80'
,
'id_card'
=>
'require|length:1,20'
,
'id_card_image_front'
=>
'require'
,
'id_card_image_back'
=>
'require'
,
];
protected
$message
=
[
'id.require'
=>
'缺少id'
,
'id.between'
=>
'id参数错误'
,
'agent_id.require'
=>
'缺少经纪人信息'
,
'agent_id.between'
=>
'经纪人信息错误'
,
'account.require'
=>
'收款名必填'
,
'account.length'
=>
'收款名长度超过限制'
,
'bank.require'
=>
'收款银行必填'
,
'bank.length'
=>
'收款银行长度超过限制'
,
'card_no.require'
=>
'身份证号码必填'
,
'card_no.length'
=>
'身份证号码长度超过限制'
,
'id_card.require'
=>
'收款银行卡号必填'
,
'id_card.length'
=>
'收款银行卡号长度超过限制'
,
'id_card_image_front.require'
=>
'身份证前面必传'
,
'id_card_image_back.require'
=>
'身份证背面必传'
,
];
protected
$scene
=
[
'add'
=>
'agent_id,account,bank,card_no,id_card,id_card_image_front,id_card_image_back'
,
'edit'
=>
'id,agent_id,account,bank,card_no,id_card'
,
];
}
\ No newline at end of file
application/model/AAgentsBank.php
0 → 100644
View file @
e2080fc8
<?php
/**
* Created by PhpStorm.
* User: fu ju
* Date: 2019/8/19
* Time: 17:52
*/
namespace
app\model
;
use
think\Db
;
class
AAgentsBank
extends
BaseModel
{
protected
$table
=
'a_agents_bank'
;
private
$db_
;
public
function
__construct
(
$data
=
[])
{
parent
::
__construct
(
$data
);
$this
->
db_
=
Db
::
name
(
$this
->
table
);
}
/**
* 新增
*
* @param $data
* @return int|string
*/
public
function
insertData
(
$data
)
{
if
(
empty
(
$data
[
'agent_id'
]))
{
return
0
;
}
$save_data
=
$this
->
buildData
(
$data
);
if
(
empty
(
$save_data
))
{
$result
=
0
;
}
else
{
$result
=
$this
->
insert
(
$data
);
}
return
$result
;
}
/**
* 编辑
*
* @param $data
* @param $where
* @return $this|int
*/
public
function
updateData
(
$data
,
$where
)
{
if
(
empty
(
$data
[
'agent_id'
]))
{
return
0
;
}
$save_data
=
$this
->
buildData
(
$data
);
if
(
empty
(
$save_data
))
{
$result
=
0
;
}
else
{
$result
=
$this
->
where
(
$where
)
->
update
(
$data
);
}
return
$result
;
}
/**
* @param $data
* @return array
*/
public
function
buildData
(
$data
)
{
$save_data
=
[];
//收款人姓名
if
(
isset
(
$data
[
'account'
]))
{
$save_data
[
'account'
]
=
$data
[
'account'
];
}
//收款人银行
if
(
isset
(
$data
[
'bank'
]))
{
$save_data
[
'bank'
]
=
$data
[
'bank'
];
}
//银行卡号
if
(
isset
(
$data
[
'card_no'
]))
{
$save_data
[
'card_no'
]
=
$data
[
'card_no'
];
}
//身份证号
if
(
isset
(
$data
[
'id_card'
]))
{
$save_data
[
'id_card'
]
=
$data
[
'id_card'
];
}
//身份证前面
if
(
isset
(
$data
[
'id_card_image_front'
]))
{
$save_data
[
'id_card_image_front'
]
=
$data
[
'id_card_image_front'
];
}
//身份证后面
if
(
isset
(
$data
[
'id_card_image_back'
]))
{
$save_data
[
'id_card_image_back'
]
=
$data
[
'id_card_image_back'
];
}
return
$save_data
;
}
}
\ No newline at end of file
application/route.php
View file @
e2080fc8
...
...
@@ -829,6 +829,7 @@ Route::group('broker', [
'agentsUnBind'
=>
[
'api_broker/CellPhone/agentsUnBind'
,
[
'method'
=>
'post'
]],
//解除绑定关系
'updateBindAXB'
=>
[
'api_broker/CellPhone/updateBindAXB'
,
[
'method'
=>
'post'
]],
//更新绑定关系隐私号码
'getCallLog'
=>
[
'api_broker/broker/getCallLog'
,
[
'method'
=>
'get|post'
]],
'editBank'
=>
[
'api_broker/broker/editBank'
,
[
'method'
=>
'post'
]],
//我的-工资卡
'agentUserTb'
=>
[
'api_broker/Client/agentUserTb'
,
[
'method'
=>
'get'
]],
//客户列表
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment