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
800cc645
Commit
800cc645
authored
Sep 10, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app新增商铺优化
parent
80834624
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
6 deletions
+41
-6
Shop.php
application/api_broker/controller/Shop.php
+28
-2
HouseService.php
application/index/service/HouseService.php
+10
-2
route.php
application/route.php
+3
-2
No files found.
application/api_broker/controller/Shop.php
View file @
800cc645
...
@@ -4,9 +4,9 @@ namespace app\api_broker\controller;
...
@@ -4,9 +4,9 @@ namespace app\api_broker\controller;
use
app\api_broker\extend\Basic
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\service\LookShopService
;
use
app\api_broker\service\LookShopService
;
use
app\api_broker\service\PushMessageService
;
use
app\api_broker\service\VerifyService
;
use
app\api_broker\service\VerifyService
;
use
app\api_broker\service\VipService
;
use
app\api_broker\service\VipService
;
use
app\index\service\HouseService
;
use
app\index\validate\HouseValidate
;
use
app\index\validate\HouseValidate
;
use
app\model\AAgents
;
use
app\model\AAgents
;
use
app\model\ACollectHouse
;
use
app\model\ACollectHouse
;
...
@@ -430,7 +430,33 @@ class Shop extends Basic
...
@@ -430,7 +430,33 @@ class Shop extends Basic
*/
*/
public
function
edit
()
public
function
edit
()
{
{
return
$this
->
response
(
101
,
'请升级最新版本'
);
$result
[
'code'
]
=
200
;
$result
[
'msg'
]
=
''
;
$result
[
'data'
]
=
[];
if
(
$this
->
request
->
isPost
())
{
$house
=
new
HouseService
();
$data
=
$house
->
addHouse
(
$this
->
params
,
$this
->
agentId
,
1
);
if
(
$data
[
'status'
]
==
'successful'
)
{
$result
[
'data'
][
'house_id'
]
=
$data
[
'data'
][
'house_id'
];
$result
[
'data'
][
'internal_title'
]
=
$data
[
'data'
][
'internal_title'
];
$result
[
'msg'
]
=
'新增或编辑成功'
;
}
else
{
$data
[
'code'
]
=
101
;
$data
[
'msg'
]
=
'Add houses failure'
;
}
}
else
{
if
(
empty
(
$this
->
params
[
'id'
]))
{
$result
[
'code'
]
=
101
;
$result
[
'msg'
]
=
'Id is null'
;
}
else
{
//获取商铺详情
$result
[
'data'
]
=
$this
->
gHousesModel
->
getHouseById
(
$this
->
params
[
'id'
],
1
);
}
}
return
$this
->
response
(
$result
[
'code'
],
$result
[
'msg'
],
$result
[
'data'
]);
}
}
/**
/**
...
...
application/index/service/HouseService.php
View file @
800cc645
...
@@ -39,10 +39,11 @@ class HouseService
...
@@ -39,10 +39,11 @@ class HouseService
*
*
* @param array $data
* @param array $data
* @param int $agent_id
* @param int $agent_id
* @param int $is_app
* @return array
* @return array
* @throws \think\exception\PDOException
* @throws \think\exception\PDOException
*/
*/
public
function
addHouse
(
array
$data
,
int
$agent_id
)
:
array
public
function
addHouse
(
array
$data
,
int
$agent_id
,
$is_app
=
0
)
:
array
{
{
$result
=
[];
$result
=
[];
$validate
=
new
HouseValidate
();
$validate
=
new
HouseValidate
();
...
@@ -75,6 +76,12 @@ class HouseService
...
@@ -75,6 +76,12 @@ class HouseService
$houses_ext
->
addHouseExt
(
$data
,
$house_id
);
$houses_ext
->
addHouseExt
(
$data
,
$house_id
);
//商铺图片
//商铺图片
if
(
$is_app
==
1
)
{
$data
[
'cover'
]
=
json_decode
(
$data
[
'cover'
],
true
);
$data
[
'slide_show'
]
=
json_decode
(
$data
[
'slide_show'
],
true
);
$data
[
'exclusive_img'
]
=
json_decode
(
$data
[
'exclusive_img'
],
true
);
}
if
(
$data
[
'id'
]
==
''
)
{
if
(
$data
[
'id'
]
==
''
)
{
$house_img
->
add
(
$data
,
$house_id
);
//只记录新增图片
$house_img
->
add
(
$data
,
$house_id
);
//只记录新增图片
}
else
{
}
else
{
...
@@ -122,7 +129,8 @@ class HouseService
...
@@ -122,7 +129,8 @@ class HouseService
}
}
}
}
$result
[
'data'
][
'house_id'
]
=
$house_id
;
$result
[
'data'
][
'house_id'
]
=
$house_id
;
$result
[
'data'
][
'internal_title'
]
=
$data
[
'internal_title'
];
$result
[
'status'
]
=
'successful'
;
$result
[
'status'
]
=
'successful'
;
$result
[
'msg'
]
=
'新增或编辑成功!'
;
$result
[
'msg'
]
=
'新增或编辑成功!'
;
return
$result
;
return
$result
;
...
...
application/route.php
View file @
800cc645
...
@@ -526,8 +526,9 @@ Route::group('broker', [
...
@@ -526,8 +526,9 @@ Route::group('broker', [
'center'
=>
[
'api_broker/MyCenter/center'
,
[
'method'
=>
'get|post'
]
],
'center'
=>
[
'api_broker/MyCenter/center'
,
[
'method'
=>
'get|post'
]
],
'houseEdit'
=>
[
'api_broker/shop/edit'
,
[
'method'
=>
'get|post'
]
],
//编辑商铺
// 'houseEdit' => [ 'api_broker/shop/edit', [ 'method' => 'get|post' ] ], //编辑商铺
'houseEditV2'
=>
[
'api_broker/shop/editV2'
,
[
'method'
=>
'get|post'
]
],
//编辑商铺
// 'houseEditV2' => [ 'api_broker/shop/editV2', [ 'method' => 'get|post' ] ], //编辑商铺
'houseEditV2'
=>
[
'api_broker/shop/edit'
,
[
'method'
=>
'get|post'
]
],
//编辑商铺
'getLabelsShopList'
=>
[
'api_broker/label/getLabelsShopList'
,
[
'method'
=>
'get'
]
],
//编辑商铺
'getLabelsShopList'
=>
[
'api_broker/label/getLabelsShopList'
,
[
'method'
=>
'get'
]
],
//编辑商铺
'uploadHouseFile'
=>
[
'api_broker/shop/uploadHouseFile'
,
[
'method'
=>
'post'
]
],
//商铺上传文件
'uploadHouseFile'
=>
[
'api_broker/shop/uploadHouseFile'
,
[
'method'
=>
'post'
]
],
//商铺上传文件
'delHouseFile'
=>
[
'api_broker/shop/delHouseFile'
,
[
'method'
=>
'post'
]
],
//商铺文件删除
'delHouseFile'
=>
[
'api_broker/shop/delHouseFile'
,
[
'method'
=>
'post'
]
],
//商铺文件删除
...
...
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