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
2e0041f4
Commit
2e0041f4
authored
Nov 26, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
site_id
parent
756e5a47
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
35 additions
and
28 deletions
+35
-28
Client.php
application/api_broker/controller/Client.php
+1
-1
Shop.php
application/api_broker/controller/Shop.php
+1
-1
Broker.php
application/index/controller/Broker.php
+2
-2
Finance.php
application/index/controller/Finance.php
+1
-1
Houses.php
application/index/controller/Houses.php
+2
-2
Member.php
application/index/controller/Member.php
+1
-1
HouseService.php
application/index/service/HouseService.php
+8
-6
UserService.php
application/index/service/UserService.php
+3
-2
GHouses.php
application/model/GHouses.php
+12
-10
GHousesToAgents.php
application/model/GHousesToAgents.php
+3
-2
ResultsSummaryNewTask.php
application/task/controller/ResultsSummaryNewTask.php
+1
-0
No files found.
application/api_broker/controller/Client.php
View file @
2e0041f4
...
...
@@ -52,7 +52,7 @@ class Client extends Basic
$user_service
=
new
UserService
();
if
(
$this
->
request
->
isPost
())
{
$result
=
$user_service
->
editUser
(
$this
->
params
[
'id'
],
$this
->
params
,
$this
->
agentId
);
$result
=
$user_service
->
editUser
(
$this
->
params
[
'id'
],
$this
->
params
,
$this
->
agentId
,
$this
->
siteId
);
if
(
$result
[
'status'
]
==
'fail'
)
{
$this
->
code
=
101
;
$this
->
msg
=
$result
[
'msg'
];
...
...
application/api_broker/controller/Shop.php
View file @
2e0041f4
...
...
@@ -696,7 +696,7 @@ class Shop extends Basic
$result_data
=
[];
$house
=
new
HouseService
();
if
(
$this
->
request
->
isPost
())
{
$data
=
$house
->
addHouse
(
$this
->
params
,
$this
->
agentId
,
1
);
$data
=
$house
->
addHouse
(
$this
->
params
,
$this
->
agentId
,
1
,
$this
->
siteId
);
if
(
$data
[
'status'
]
==
'successful'
)
{
$result_data
[
'house_id'
]
=
$data
[
'data'
][
'house_id'
];
...
...
application/index/controller/Broker.php
View file @
2e0041f4
...
...
@@ -173,9 +173,9 @@ class Broker extends Basic
$hg
=
new
GHousesToAgents
();
switch
(
$this
->
params
[
'type'
])
{
case
1
:
$res
=
$hg
->
addAgents
(
$this
->
params
[
'agents_id'
],
$this
->
params
[
'houses_id'
],
$this
->
params
[
'type'
],
$this
->
userId
);
break
;
$res
=
$hg
->
addAgents
(
$this
->
params
[
'agents_id'
],
$this
->
params
[
'houses_id'
],
$this
->
params
[
'type'
],
$this
->
userId
,
$this
->
siteId
);
break
;
case
2
:
$res
=
$hg
->
addAgents
(
$this
->
params
[
'agents_id'
],
$this
->
params
[
'houses_id'
],
$this
->
params
[
'type'
],
$this
->
userId
);
break
;
$res
=
$hg
->
addAgents
(
$this
->
params
[
'agents_id'
],
$this
->
params
[
'houses_id'
],
$this
->
params
[
'type'
],
$this
->
userId
,
$this
->
siteId
);
break
;
default
:
$res
=
[];
$data
[
'status'
]
=
101
;
...
...
application/index/controller/Finance.php
View file @
2e0041f4
...
...
@@ -2110,7 +2110,7 @@ class Finance extends Basic
//更新业绩统计
$sum
=
new
ResultsSummaryNewTask
();
$date
=
date
(
'Y-m-d'
,
strtotime
(
$create_time
));
$sum
->
updateTotalByAgentId
(
$id
,
$store_id
,
$district_id
,
$date
);
//被修改的人
$sum
->
updateTotalByAgentId
(
$id
,
$store_id
,
$district_id
,
$date
,
$this
->
siteId
);
//被修改的人
}
/**
...
...
application/index/controller/Houses.php
View file @
2e0041f4
...
...
@@ -54,7 +54,7 @@ class Houses extends Basic
$house
=
new
HouseService
();
if
(
$this
->
request
->
isPost
())
{
$house_data
=
$house
->
addHouse
(
$this
->
params
,
$this
->
userId
);
$house_data
=
$house
->
addHouse
(
$this
->
params
,
$this
->
userId
,
$this
->
siteId
);
if
(
$house_data
[
'status'
]
==
'successful'
)
{
if
(
!
empty
(
$this
->
params
[
'sublet_id'
])
&&
$this
->
params
[
'source'
]
==
'transfer_list'
)
{
...
...
@@ -483,7 +483,7 @@ class Houses extends Basic
public
function
editExclusive
()
{
if
(
$this
->
params
[
'houses_id'
])
{
$this
->
data
=
$this
->
house
->
exclusive
(
$this
->
params
,
$this
->
params
[
'houses_id'
],
$this
->
userId
);
$this
->
data
=
$this
->
house
->
exclusive
(
$this
->
params
,
$this
->
params
[
'houses_id'
],
$this
->
userId
,
$this
->
siteId
);
}
else
{
$this
->
code
=
101
;
$this
->
msg
=
'houses_id is null'
;
...
...
application/index/controller/Member.php
View file @
2e0041f4
...
...
@@ -416,7 +416,7 @@ class Member extends Basic{
$data
=
[];
$user_service
=
new
UserService
();
if
(
$this
->
request
->
isPost
())
{
$result
=
$user_service
->
editUser
(
$this
->
params
[
'id'
],
$this
->
params
,
$this
->
userId
);
$result
=
$user_service
->
editUser
(
$this
->
params
[
'id'
],
$this
->
params
,
$this
->
userId
,
$this
->
siteId
);
if
(
$result
[
'status'
]
==
'fail'
)
{
$this
->
code
=
101
;
$this
->
msg
=
$result
[
'msg'
];
...
...
application/index/service/HouseService.php
View file @
2e0041f4
...
...
@@ -47,9 +47,10 @@ class HouseService
* @param array $data
* @param int $agent_id
* @param int $is_app
* @param int $site_id
* @return array
*/
public
function
addHouse
(
array
$data
,
int
$agent_id
,
$is_app
=
0
)
:
array
public
function
addHouse
(
array
$data
,
int
$agent_id
,
$is_app
=
0
,
$site_id
)
:
array
{
$result
=
[];
$validate
=
new
HouseValidate
();
...
...
@@ -148,7 +149,7 @@ class HouseService
//案场权限人
if
(
isset
(
$data
[
'agent_data'
]))
{
$result_agent_data
=
$this
->
releaseRelationship
(
$data
[
'agent_data'
],
$house_id
,
1
,
$agent_id
,
$data
[
'internal_title'
]);
$result_agent_data
=
$this
->
releaseRelationship
(
$data
[
'agent_data'
],
$house_id
,
1
,
$agent_id
,
$data
[
'internal_title'
]
,
$site_id
);
if
(
$result_agent_data
[
'status'
]
==
'fail'
)
{
$result
[
'status'
]
=
'fail'
;
...
...
@@ -159,7 +160,7 @@ class HouseService
//盘方
if
(
isset
(
$data
[
'agent_dish'
]))
{
$result_agent_dish
=
$this
->
releaseRelationship
(
$data
[
'agent_dish'
],
$house_id
,
2
,
$agent_id
,
$data
[
'internal_title'
]);
$result_agent_dish
=
$this
->
releaseRelationship
(
$data
[
'agent_dish'
],
$house_id
,
2
,
$agent_id
,
$data
[
'internal_title'
]
,
$site_id
);
if
(
$result_agent_dish
[
'status'
]
==
'fail'
)
{
$result
[
'status'
]
=
'fail'
;
$result
[
'msg'
]
=
'新增或编辑盘方失败,'
.
$result_agent_dish
[
'msg'
];
...
...
@@ -169,7 +170,7 @@ class HouseService
//独家方
if
(
isset
(
$data
[
'exclusive_ids'
]))
{
$result_exclusive_ids
=
$this
->
releaseRelationship
(
$data
[
'exclusive_ids'
],
$house_id
,
3
,
$agent_id
,
$data
[
'internal_title'
]);
$result_exclusive_ids
=
$this
->
releaseRelationship
(
$data
[
'exclusive_ids'
],
$house_id
,
3
,
$agent_id
,
$data
[
'internal_title'
]
,
$site_id
);
if
(
$result_exclusive_ids
[
'status'
]
==
'fail'
)
{
$result
[
'status'
]
=
'fail'
;
$result
[
'msg'
]
=
'新增或编辑独家方失败,'
.
$result_exclusive_ids
[
'msg'
];
...
...
@@ -233,10 +234,11 @@ class HouseService
* @param $type
* @param $operation_id
* @param $house_title
* @param $site_id
* @return bool
* @throws \think\exception\PDOException
*/
public
function
releaseRelationship
(
$agent_data
,
$house_id
,
$type
,
$operation_id
,
$house_title
)
public
function
releaseRelationship
(
$agent_data
,
$house_id
,
$type
,
$operation_id
,
$house_title
,
$site_id
)
{
if
(
empty
(
$agent_data
))
{
return
false
;
...
...
@@ -300,7 +302,7 @@ class HouseService
$agent_name
=
[];
foreach
(
$add_agent_id
as
$k
=>
$v
)
{
$agent_data
=
$this
->
agent
->
verifyUser
(
'id,store_id,district_id,name'
,
''
,
[
'id'
=>
$v
]);
//获取被修改人信息
$sum
->
updateTotalByAgentId
(
$agent_data
[
'id'
],
$agent_data
[
'store_id'
],
$agent_data
[
'district_id'
],
$date
);
//被修改的人
$sum
->
updateTotalByAgentId
(
$agent_data
[
'id'
],
$agent_data
[
'store_id'
],
$agent_data
[
'district_id'
],
$date
,
$site_id
);
//被修改的人
$agent_name
[]
=
$agent_data
[
'name'
];
}
$remark
=
'新增盘方:'
.
implode
(
','
,
$agent_name
);
...
...
application/index/service/UserService.php
View file @
2e0041f4
...
...
@@ -37,9 +37,10 @@ class UserService
* @param $id
* @param $data
* @param $operation_id
* @param $site_id
* @return array|int|mixed
*/
public
function
editUser
(
$id
,
$data
,
$operation_id
)
public
function
editUser
(
$id
,
$data
,
$operation_id
,
$site_id
)
{
$validate
=
new
MemberValidate
();
if
(
!
$validate
->
scene
(
'add'
)
->
check
(
$data
))
{
...
...
@@ -121,7 +122,7 @@ class UserService
$agent_data
=
$agent
->
getAgentInfo
(
'id,name,phone,store_id,district_id'
,
$data
[
'agents_id'
]);
$sum
=
new
ResultsSummaryNewTask
();
$date
=
date
(
'Y-m-d'
);
$sum
->
updateTotalByAgentId
(
$agent_data
[
'id'
],
$agent_data
[
'store_id'
],
$agent_data
[
'district_id'
],
$date
);
$sum
->
updateTotalByAgentId
(
$agent_data
[
'id'
],
$agent_data
[
'store_id'
],
$agent_data
[
'district_id'
],
$date
,
$site_id
);
}
catch
(
\Exception
$e
)
{
$result
[
'status'
]
=
'fail'
;
$result
[
'msg'
]
=
$e
->
getMessage
();
...
...
application/model/GHouses.php
View file @
2e0041f4
...
...
@@ -491,17 +491,17 @@ class GHouses extends BaseModel
//权限人
if
(
isset
(
$params
[
'agent_data'
]))
{
$agents
->
addAgents
(
$params
[
'agent_data'
],
$house_id
,
1
,
$agent_id
);
//
$agents->addAgents($params['agent_data'], $house_id, 1, $agent_id);
}
//盘方
if
(
isset
(
$params
[
'agent_dish'
]))
{
$agents
->
addAgents
(
$params
[
'agent_dish'
],
$house_id
,
2
,
$agent_id
);
//
$agents->addAgents($params['agent_dish'], $house_id, 2, $agent_id);
}
//独家方
if
(
isset
(
$params
[
'exclusive_ids'
]))
{
$agents
->
addAgents
(
$params
[
'exclusive_ids'
],
$house_id
,
3
,
$agent_id
);
//
$agents->addAgents($params['exclusive_ids'], $house_id, 3, $agent_id);
}
if
(
$house_id
!=
NULL
)
{
...
...
@@ -800,7 +800,7 @@ class GHouses extends BaseModel
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public
function
exclusive
(
$data
,
$house_id
,
$operation_id
)
public
function
exclusive
(
$data
,
$house_id
,
$operation_id
,
$site_id
)
{
$this
->
startTrans
();
$result
=
$this
->
save
([
...
...
@@ -818,7 +818,7 @@ class GHouses extends BaseModel
$house_img
->
editExclusiveImg
(
$data
,
$house_id
);
$agents
=
new
GHousesToAgents
();
$agents
->
addAgents
(
$data
[
'exclusive_id'
],
$house_id
,
3
,
$operation_id
);
$agents
->
addAgents
(
$data
[
'exclusive_id'
],
$house_id
,
3
,
$operation_id
,
$site_id
);
$m_house_file
=
new
GHouseFile
();
...
...
@@ -1325,13 +1325,15 @@ class GHouses extends BaseModel
* 添加和编辑商铺
*
* @param $params
* @param $agent_id
* @param $site_id
* @return mixed
* @throws \Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public
function
app_addV2
(
$params
,
$agent_id
)
public
function
app_addV2
(
$params
,
$agent_id
,
$site_id
)
{
$this
->
startTrans
();
if
(
isset
(
$params
[
'phone'
]))
{
...
...
@@ -1516,17 +1518,17 @@ class GHouses extends BaseModel
$agents
=
new
GHousesToAgents
();
//权限人
if
(
isset
(
$params
[
'agent_data'
]))
{
$agents
->
addAgents
(
$params
[
'agent_data'
],
$house_id
,
1
,
$agent_id
);
$agents
->
addAgents
(
$params
[
'agent_data'
],
$house_id
,
1
,
$agent_id
,
$site_id
);
}
//盘方
if
(
isset
(
$params
[
'agent_dish'
]))
{
$agents
->
addAgents
(
$params
[
'agent_dish'
],
$house_id
,
2
,
$agent_id
);
$agents
->
addAgents
(
$params
[
'agent_dish'
],
$house_id
,
2
,
$agent_id
,
$site_id
);
}
//独家方
if
(
isset
(
$params
[
'exclusive_ids'
]))
{
$agents
->
addAgents
(
$params
[
'exclusive_ids'
],
$house_id
,
3
,
$agent_id
);
$agents
->
addAgents
(
$params
[
'exclusive_ids'
],
$house_id
,
3
,
$agent_id
,
$site_id
);
}
//1列表页封面图,2详情页轮播图,3楼层平面图,4独家合同
...
...
application/model/GHousesToAgents.php
View file @
2e0041f4
...
...
@@ -17,12 +17,13 @@ class GHousesToAgents extends BaseModel
* @param $houses_id
* @param int $type 案场权限人:0,盘方:1,独家:2
* @param $operation_id
* @param $site_id
* @return array|false|int
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
addAgents
(
$agents_id
,
$houses_id
,
$type
,
$operation_id
)
public
function
addAgents
(
$agents_id
,
$houses_id
,
$type
,
$operation_id
,
$site_id
)
{
$agent_arr
=
[];
$agents_id
=
array_unique
(
explode
(
','
,
$agents_id
));
...
...
@@ -122,7 +123,7 @@ class GHousesToAgents extends BaseModel
//更新业绩统计
$sum
=
new
ResultsSummaryNewTask
();
$sum
->
updateTotalByAgentId
(
$agent_data
[
'id'
],
$agent_data
[
'store_id'
],
$agent_data
[
'district_id'
],
$date
);
//被修改的人
$sum
->
updateTotalByAgentId
(
$agent_data
[
'id'
],
$agent_data
[
'store_id'
],
$agent_data
[
'district_id'
],
$date
,
$site_id
);
//被修改的人
$agent_push
[]
=
$agent_data
[
'name'
];
}
}
...
...
application/task/controller/ResultsSummaryNewTask.php
View file @
2e0041f4
...
...
@@ -163,6 +163,7 @@ class ResultsSummaryNewTask
* @param $store_id
* @param $district_id
* @param $total_time string 比如修改了数据如成交报告,成交报告提交时间是昨天那么这里的时间就是昨天
* @param $site_id
*/
public
function
updateTotalByAgentId
(
$agent_id
,
$store_id
,
$district_id
,
$total_time
,
$site_id
)
{
...
...
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