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
4701ce20
Commit
4701ce20
authored
Dec 12, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
fa234e4e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
22 deletions
+49
-22
Broker.php
application/index/controller/Broker.php
+39
-22
AAgentsBlackList.php
application/model/AAgentsBlackList.php
+10
-0
No files found.
application/index/controller/Broker.php
View file @
4701ce20
...
...
@@ -912,30 +912,12 @@ class Broker extends Basic
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$save_data
[
'status'
]
=
4
;
$save_data
[
'id'
]
=
$params
[
'agents_id'
];
$broker_service
=
new
BrokerService
();
$data
=
$broker_service
->
updateStatus
(
$save_data
,
$this
->
userId
);
if
(
$data
[
'status'
]
==
'fail'
)
{
return
$this
->
response
(
"101"
,
$data
[
'msg'
]);
}
$m_agents_black_list
=
new
AAgentsBlackList
();
$m_agents_black_list_img
=
new
AAgentsBlackListImg
();
//先判断是否已经存在数据
$field
=
'id,status'
;
$get_params
[
'status'
]
=
0
;
$get_params
[
'agents_id'
]
=
$params
[
"agents_id"
];
$get_data_res
=
$m_agents_black_list
->
getDatas
(
$field
,
$get_params
);
if
(
$get_data_res
){
//如果存在
$res
=
true
;
}
else
{
//不存在则新增数据
$insert
[
"agents_id"
]
=
$params
[
'agents_id'
];
if
(
$params
[
"agents_black_list_id"
]){
//更新
$insert
[
"id"
]
=
$params
[
"agents_black_list_id"
];
$insert
[
"content"
]
=
$params
[
'content'
];
$insert
[
"status"
]
=
0
;
$res
=
$m_agents_black_list
->
saveData
(
$insert
);
$res
=
$m_agents_black_list
->
updateDatas
(
$insert
);
if
(
$res
&&
$params
[
"img_info"
]){
foreach
(
explode
(
','
,
$params
[
"img_info"
])
as
$k
=>
$v
){
$insert
=
[];
...
...
@@ -946,7 +928,42 @@ class Broker extends Basic
$res
=
$m_agents_black_list_img
->
saveData
(
$insert
);
}
}
}
else
{
//新增
$save_data
[
'status'
]
=
4
;
$save_data
[
'id'
]
=
$params
[
'agents_id'
];
$broker_service
=
new
BrokerService
();
$data
=
$broker_service
->
updateStatus
(
$save_data
,
$this
->
userId
);
if
(
$data
[
'status'
]
==
'fail'
)
{
return
$this
->
response
(
"101"
,
$data
[
'msg'
]);
}
//先判断是否已经存在数据
$field
=
'id,status'
;
$get_params
[
'status'
]
=
0
;
$get_params
[
'agents_id'
]
=
$params
[
"agents_id"
];
$get_data_res
=
$m_agents_black_list
->
getDatas
(
$field
,
$get_params
);
if
(
$get_data_res
){
//如果存在
$res
=
true
;
}
else
{
//不存在则新增数据
$insert
[
"agents_id"
]
=
$params
[
'agents_id'
];
$insert
[
"content"
]
=
$params
[
'content'
];
$insert
[
"status"
]
=
0
;
$res
=
$m_agents_black_list
->
saveData
(
$insert
);
if
(
$res
&&
$params
[
"img_info"
]){
foreach
(
explode
(
','
,
$params
[
"img_info"
])
as
$k
=>
$v
){
$insert
=
[];
$insert
[
"file_name"
]
=
$v
;
$insert
[
"father_id"
]
=
$res
;
$insert
[
"type"
]
=
0
;
$insert
[
"status"
]
=
0
;
$res
=
$m_agents_black_list_img
->
saveData
(
$insert
);
}
}
}
}
if
(
$res
)
{
return
$this
->
response
(
"200"
,
"成功"
);
}
else
{
...
...
@@ -1006,7 +1023,7 @@ class Broker extends Basic
if
(
!
isset
(
$params
[
"agents_black_list_id"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$internet_path
=
CURRENT_URL
.
'
public/
static/agent_black_list/'
;
$internet_path
=
CURRENT_URL
.
'static/agent_black_list/'
;
$m_agents_black_list
=
new
AAgentsBlackList
();
$m_agents_black_list_img
=
new
AAgentsBlackListImg
();
...
...
application/model/AAgentsBlackList.php
View file @
4701ce20
...
...
@@ -69,4 +69,14 @@ class AAgentsBlackList extends Model
return
$result
;
}
/**
* 更新数据
*/
public
function
updateDatas
(
$params
)
{
$result
=
$this
->
update
(
$params
);
//dump($this->getLastSql());
return
$result
;
}
}
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