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
2c481061
Commit
2c481061
authored
May 15, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
3c69e2e7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
32 deletions
+51
-32
LookShop.php
application/api_broker/controller/LookShop.php
+44
-27
Shop.php
application/api_broker/controller/Shop.php
+4
-4
GHouses.php
application/model/GHouses.php
+3
-1
No files found.
application/api_broker/controller/LookShop.php
View file @
2c481061
<?php
namespace
app\api_broker\controller
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\service\LookShopService
;
use
app\model\AAgents
;
use
app\model\SystemConfig
;
use
think\Request
;
/**
...
...
@@ -12,9 +15,11 @@ use think\Request;
* Time : 上午11:29
* Intro:
*/
class
LookShop
extends
Basic
{
protected
$lookShopService_
;
class
LookShop
extends
Basic
{
protected
$lookShopService_
;
protected
$agentsModel
;
function
__construct
(
Request
$request
=
null
)
{
parent
::
__construct
(
$request
);
...
...
@@ -26,23 +31,24 @@ class LookShop extends Basic{
* 升级经纪人的看铺数量
* @return \think\Response
*/
public
function
setAgentLookNum
(){
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"
,
"请求参数错误"
);
/* $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"
,
"升级看铺数量失败"
);
if
(
$is_ok
)
{
return
$this
->
response
(
"200"
,
"request success"
,
[]);
}
else
{
return
$this
->
response
(
"101"
,
"升级看铺数量失败"
);
}
}
...
...
@@ -53,32 +59,42 @@ class LookShop extends Basic{
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAgentsResidueNumList
(){
public
function
getAgentsResidueNumList
()
{
$params
=
$this
->
params
;
/* $params = array(
"store_id" => 1,
);*/
if
(
!
isset
(
$params
[
"store_id"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
/* $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"
);
$where_
[
"level"
]
=
10
;
$agentList
=
$this
->
agentsModel
->
getAgentById
(
$field
,
$where_
);
if
(
count
(
$agentList
)
<=
0
)
{
return
$this
->
response
(
"101"
,
"request null"
);
}
$systemConfigModel
=
new
SystemConfig
();
$lookNum
=
0
;
$data
=
$systemConfigModel
->
getSetting
([
"config_type"
=>
40
],
"rule"
);
if
(
$data
&&
$data
[
"agent_shop_num"
]
>
0
)
{
$lookNum
=
$data
[
"agent_shop_num"
];
}
foreach
(
$agentList
as
$key
=>
$item
){
foreach
(
$agentList
as
$key
=>
$item
)
{
$residue_num
=
$this
->
lookShopService_
->
isLookShop
(
$item
[
"id"
]);
if
(
$residue_num
<=
0
)
{
if
(
$residue_num
<=
0
)
{
$agentList
[
$key
][
"is_show_button"
]
=
true
;
}
else
{
}
else
{
$agentList
[
$key
][
"is_show_button"
]
=
false
;
}
}
return
$this
->
response
(
"200"
,
"request success"
,
$agentList
);
$result
[
"look_num"
]
=
$lookNum
;
$result
[
"list"
]
=
$agentList
;
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
}
\ No newline at end of file
application/api_broker/controller/Shop.php
View file @
2c481061
...
...
@@ -200,11 +200,11 @@ class Shop extends Basic
public
function
getShopDetail
()
{
header
(
'Access-Control-Allow-Origin:*'
);
/*
$params = array(
"id" => 4
45
,
$params
=
array
(
"id"
=>
4
,
"site_area"
=>
3
,
//1.c端 3.b端
"user_id" => 2 //if c端 用户登录后传入user_id
);
*/
//
"user_id" => 2 //if c端 用户登录后传入user_id
);
$params
=
$this
->
params
;
$conditions
=
[];
...
...
application/model/GHouses.php
View file @
2c481061
...
...
@@ -563,12 +563,14 @@ class GHouses extends BaseModel
*/
public
function
getHouseDetailById
(
$field
,
$params
)
{
return
Db
::
table
(
$this
->
table
)
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
'g_houses_ext b'
,
'a.id=b.house_id'
,
'left'
)
->
where
(
$params
)
->
find
(
$params
[
"a.id"
]);
echo
Db
::
table
(
$this
->
table
)
->
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