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
6dacdc6b
Commit
6dacdc6b
authored
May 08, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
个人中心升级看铺数
parent
7a372469
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
103 additions
and
2 deletions
+103
-2
LookShop.php
application/api_broker/controller/LookShop.php
+85
-0
OrderLog.php
application/api_broker/controller/OrderLog.php
+2
-2
AAgents.php
application/model/AAgents.php
+10
-0
route.php
application/route.php
+6
-0
No files found.
application/api_broker/controller/LookShop.php
0 → 100644
View file @
6dacdc6b
<?php
namespace
app\api_broker\controller
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\service\LookShopService
;
use
app\model\AAgents
;
use
think\Request
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/5/8
* Time : 上午11:29
* Intro:
*/
class
LookShop
extends
Basic
{
protected
$lookShopService_
;
protected
$agentsModel
;
function
__construct
(
Request
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
lookShopService_
=
new
LookShopService
();
$this
->
agentsModel
=
new
AAgents
();
}
/**
* 升级经纪人的看铺数量
* @return \think\Response
*/
public
function
setAgentLookNum
(){
$params
=
$this
->
params
;
/* $params = array(
"agent_id" => 1,
"submit_agent_id" => 1,
);*/
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"submit_agent_id"
])){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
//todo 验证申请提交人和此经纪人是否是所属关系
$is_ok
=
$this
->
lookShopService_
->
setAgentLookNum
(
$params
[
"agent_id"
]);
if
(
$is_ok
){
return
$this
->
response
(
"200"
,
"request success"
,[]);
}
else
{
return
$this
->
response
(
"101"
,
"升级看铺数量失败"
);
}
}
/**
* 经纪人列表
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAgentsResidueNumList
(){
$params
=
$this
->
params
;
/* $params = array(
"store_id" => 1,
);*/
if
(
!
isset
(
$params
[
"store_id"
])){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$field
=
"id,store_id,level,name,phone,img"
;
$where_
[
"store_id"
]
=
$params
[
"store_id"
];
$where_
[
"status"
]
=
0
;
$where_
[
"level"
]
=
10
;
$agentList
=
$this
->
agentsModel
->
getAgentById
(
$field
,
$where_
);
if
(
count
(
$agentList
)
<=
0
){
return
$this
->
response
(
"101"
,
"request null"
);
}
foreach
(
$agentList
as
$key
=>
$item
){
$residue_num
=
$this
->
lookShopService_
->
isLookShop
(
$item
[
"id"
]);
if
(
$residue_num
<=
0
){
$agentList
[
$key
][
"is_show_button"
]
=
true
;
}
else
{
$agentList
[
$key
][
"is_show_button"
]
=
false
;
}
}
return
$this
->
response
(
"200"
,
"request success"
,
$agentList
);
}
}
\ No newline at end of file
application/api_broker/controller/OrderLog.php
View file @
6dacdc6b
...
@@ -156,9 +156,9 @@ class OrderLog extends Basic
...
@@ -156,9 +156,9 @@ class OrderLog extends Basic
}
}
$is_ok
=
$this
->
service_
->
updateBillInfo
(
$params
[
"p_id"
],
$params
[
"trade_no"
],
$params
[
"pay_time"
],
$params
[
"real_money"
]);
$is_ok
=
$this
->
service_
->
updateBillInfo
(
$params
[
"p_id"
],
$params
[
"trade_no"
],
$params
[
"pay_time"
],
$params
[
"real_money"
]);
if
(
$is_ok
>
0
){
if
(
$is_ok
>
0
){
return
$this
->
response
(
"200"
,
"
request update success
"
);
return
$this
->
response
(
"200"
,
"
支付成功!
"
);
}
else
{
}
else
{
return
$this
->
response
(
"101"
,
"
update faild
"
);
return
$this
->
response
(
"101"
,
"
支付失败!
"
);
}
}
}
}
...
...
application/model/AAgents.php
View file @
6dacdc6b
...
@@ -285,6 +285,16 @@ class AAgents extends BaseModel
...
@@ -285,6 +285,16 @@ class AAgents extends BaseModel
if
(
isset
(
$params
[
"agent_id"
]))
{
if
(
isset
(
$params
[
"agent_id"
]))
{
$where_
[
"id"
]
=
$params
[
"agent_id"
];
$where_
[
"id"
]
=
$params
[
"agent_id"
];
}
}
if
(
isset
(
$params
[
"store_id"
]))
{
$where_
[
"store_id"
]
=
$params
[
"store_id"
];
}
if
(
isset
(
$params
[
"status"
]))
{
$where_
[
"status"
]
=
$params
[
"status"
];
}
if
(
isset
(
$params
[
"level"
]))
{
$where_
[
"level"
]
=
$params
[
"level"
];
}
$result
=
$this
->
field
(
$field
)
$result
=
$this
->
field
(
$field
)
->
where
(
$where_
)
->
where
(
$where_
)
...
...
application/route.php
View file @
6dacdc6b
...
@@ -427,6 +427,11 @@ Route::group('broker', [
...
@@ -427,6 +427,11 @@ Route::group('broker', [
'getAgentsResidueNumList'
=>
[
'api_broker/LookShop/getAgentsResidueNumList'
,
[
'method'
=>
'get'
]
],
//剩余铺数列表
'setAgentLookNum'
=>
[
'api_broker/LookShop/setAgentLookNum'
,
[
'method'
=>
'post'
]
],
//设置经纪人的看铺数量
]);
]);
//Route::miss('api/index/miss');//处理错误的url
//Route::miss('api/index/miss');//处理错误的url
\ No newline at end of file
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