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
26096ed9
Commit
26096ed9
authored
Mar 19, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app_add
parent
48389bb6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
2 deletions
+56
-2
Shop.php
application/api_broker/controller/Shop.php
+1
-1
GHouses.php
application/model/GHouses.php
+55
-1
No files found.
application/api_broker/controller/Shop.php
View file @
26096ed9
...
...
@@ -264,7 +264,7 @@ class Shop extends Basic
if
(
$this
->
request
->
isPost
())
{
$this
->
gHousesModel
->
startTrans
();
$this
->
params
[
'userId'
]
=
$this
->
agentId
;
$house_id
=
$this
->
gHousesModel
->
add
(
$this
->
params
);
//添加或编辑商铺
$house_id
=
$this
->
gHousesModel
->
a
pp_a
dd
(
$this
->
params
);
//添加或编辑商铺
if
(
$house_id
)
{
$this
->
gHousesModel
->
commit
();
$result
[
'data'
][
'house_id'
]
=
$house_id
;
...
...
application/model/GHouses.php
View file @
26096ed9
...
...
@@ -449,7 +449,7 @@ class GHouses extends BaseModel
->
join
(
'g_houses_ext b'
,
'a.id=b.house_id'
,
'left'
)
->
where
(
$params
)
->
find
(
$params
[
"id"
]);
}
}
/**
* 获取经纪人时间段中新添加的楼盘个数
...
...
@@ -493,4 +493,58 @@ class GHouses extends BaseModel
/******zw end ************/
/**
* 添加和编辑商铺
*
* @param $params
* @return mixed
* @throws \Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
app_add
(
$params
){
$case
=
new
ACase
();
$case_id
=
$case
->
addCase
(
$params
[
'phone'
]);
$params
[
'case_id'
]
=
$case_id
;
$regions
=
new
Regions
();
$code_arr
=
$regions
->
getRegionsCodeByName
(
$params
[
'province'
],
$params
[
'city'
],
$params
[
'disc'
]);
$params
[
'code'
]
=
implode
(
'##'
,
$code_arr
);
//新增或编辑
if
(
$params
[
'id'
]
==
''
)
{
$params
[
'upload_id'
]
=
$params
[
'userId'
];
$this
->
allowField
(
true
)
->
save
(
$params
);
$house_id
=
$this
->
id
;
}
else
{
$params
[
'operation_id'
]
=
$params
[
'userId'
];
$this
->
allowField
(
true
)
->
isUpdate
(
true
)
->
save
(
$params
,
[
'id'
=>
$params
[
'id'
]
]);
$house_id
=
$this
->
id
;
}
$params
[
'house_id'
]
=
$house_id
;
if
(
$params
[
'start_business_date'
])
{
$params
[
'start_business_date'
]
=
date
(
'Y-m-d H:i:s'
,
strtotime
(
$params
[
'start_business_date'
]));
}
$houses_ext
=
new
GHousesExt
();
//新增或编辑根据id
if
(
$params
[
'id'
]
==
''
)
{
$houses_ext
->
allowField
(
true
)
->
save
(
$params
);
}
else
{
$house_ext_data
=
$houses_ext
->
field
(
'id'
)
->
where
(
'house_id'
,
$params
[
'id'
])
->
find
();
$houses_ext
->
allowField
(
true
)
->
isUpdate
(
true
)
->
save
(
$params
,
[
'id'
=>
$house_ext_data
[
'id'
]
]);
}
$agents
=
new
GHousesToAgents
();
//权限人
$agents
->
addAgents
(
$params
[
'agent_data'
],
$house_id
,
1
);
//盘方
$agents
->
addAgents
(
$params
[
'agent_dish'
],
$house_id
,
2
);
//独家方
$agents
->
addAgents
(
$params
[
'exclusive_ids'
],
$house_id
,
3
);
return
$house_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