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
bb3923bb
Commit
bb3923bb
authored
Feb 05, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店添加编辑,获取城市列表
parent
08ca4cd0
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
242 additions
and
7 deletions
+242
-7
BusinessDistrict.php
application/index/controller/BusinessDistrict.php
+15
-0
Store.php
application/index/controller/Store.php
+74
-0
index.html
application/index/view/store/index.html
+11
-0
ADistrict.php
application/model/ADistrict.php
+4
-1
AStore.php
application/model/AStore.php
+83
-0
JournalAccounts.php
application/model/JournalAccounts.php
+1
-0
Regions.php
application/model/Regions.php
+8
-3
Remarks.php
application/model/Remarks.php
+42
-1
route.php
application/route.php
+4
-2
No files found.
application/index/controller/BusinessDistrict.php
View file @
bb3923bb
...
@@ -121,4 +121,18 @@ class BusinessDistrict extends Basic
...
@@ -121,4 +121,18 @@ class BusinessDistrict extends Basic
$data
=
$regions
->
getRegions
(
$params
[
'code'
],
$params
[
'parent_code'
],
$params
[
'type'
]);
$data
=
$regions
->
getRegions
(
$params
[
'code'
],
$params
[
'parent_code'
],
$params
[
'type'
]);
return
$this
->
response
(
200
,
''
,
$data
);
return
$this
->
response
(
200
,
''
,
$data
);
}
}
/**
* 获取所有的城市
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getCity
()
{
$region
=
new
Regions
();
$city
=
$region
->
where
(
'type'
,
2
)
->
select
();
return
$this
->
response
(
200
,
''
,
$city
);
}
}
}
\ No newline at end of file
application/index/controller/Store.php
0 → 100644
View file @
bb3923bb
<?php
/**
* Created by PhpStorm.
* User: hu jun
* Date: 2018/2/2
* Time: 10:32
*/
namespace
app\index\controller
;
use
app\index\extend\Basic
;
use
app\model\AStore
;
class
Store
extends
Basic
{
/**
* @return \think\response\View
*/
public
function
index
()
{
$result
[
'code'
]
=
200
;
$result
[
'msg'
]
=
''
;
if
(
$this
->
request
->
isAjax
())
{
}
else
{
//总监列表
$return
=
view
(
'index'
);
}
return
$return
;
}
/**
* 添加门店
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public
function
addStore
()
{
$district
=
new
AStore
();
if
(
$this
->
params
[
'agents_id'
]
||
$this
->
params
[
'id'
])
{
$this
->
data
=
$district
->
addStoreAgents
(
$this
->
params
,
$this
->
params
[
'agents_id'
]);
}
else
{
$this
->
code
=
101
;
$this
->
msg
=
'agents_id or id is null'
;
}
return
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
}
/**
* 通过id获取门店信息
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getStoreById
()
{
$district
=
new
AStore
();
if
(
$this
->
params
[
'id'
])
{
$this
->
data
=
$district
->
getStoreById
(
$this
->
params
[
'id'
]);
}
else
{
$this
->
code
=
101
;
$this
->
msg
=
'id is null'
;
}
return
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
}
}
\ No newline at end of file
application/index/view/store/index.html
0 → 100644
View file @
bb3923bb
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
Title
</title>
</head>
<body>
</body>
</html>
\ No newline at end of file
application/model/ADistrict.php
View file @
bb3923bb
...
@@ -29,7 +29,10 @@ class ADistrict extends BaseModel
...
@@ -29,7 +29,10 @@ class ADistrict extends BaseModel
if
(
$this
->
id
)
{
if
(
$this
->
id
)
{
$agents
=
new
AAgents
();
$agents
=
new
AAgents
();
$agents_edit
=
$agents
->
save
([
'district_id'
=>
$this
->
id
],[
'id'
=>
$agents_id
]);
$agents_data
[
'district_id'
]
=
$this
->
id
;
$agents_data
[
'level'
]
=
30
;
$agents_edit
=
$agents
->
editData
(
$agents_data
,
$agents_id
,
'id'
);
if
(
$agents_edit
)
{
if
(
$agents_edit
)
{
$resutlt
=
$this
->
id
;
$resutlt
=
$this
->
id
;
$this
->
commit
();
$this
->
commit
();
...
...
application/model/AStore.php
0 → 100644
View file @
bb3923bb
<?php
/**
* Created by PhpStorm.
* User: hu jun
* Date: 2018/2/2
* Time: 14:28
*/
namespace
app\model
;
class
AStore
extends
BaseModel
{
/**
* 添加门店,绑定店长关系
*
* @param $data
* @param $agents_id
* @return bool|mixed
* @throws \Exception
* @throws \think\exception\PDOException3
*/
public
function
addStoreAgents
(
$data
,
$agents_id
)
{
$regions
=
new
Regions
();
$code_arr
=
$regions
->
getRegionsCodeByName
(
$data
[
'province'
],
$data
[
'city'
],
$data
[
'district'
]);
$store_data
[
'province'
]
=
$data
[
'province'
];
$store_data
[
'city'
]
=
$data
[
'city'
];
$store_data
[
'district'
]
=
$data
[
'district'
];
$store_data
[
'address'
]
=
$data
[
'address'
];
$store_data
[
'longitude'
]
=
$data
[
'longitude'
];
$store_data
[
'latitude'
]
=
$data
[
'latitude'
];
$store_data
[
'store_name'
]
=
$data
[
'store_name'
];
$store_data
[
'scale'
]
=
$data
[
'scale'
];
$store_data
[
'district_id'
]
=
$data
[
'district_id'
];
$store_data
[
'code'
]
=
implode
(
'##'
,
$code_arr
);
$agents
=
new
AAgents
();
if
(
$data
[
'id'
]
==
''
)
{
$store_data
[
'create_time'
]
=
date
(
'Y-m-d H:i:s'
);
$this
->
save
(
$store_data
);
$agents_data
[
'store_id'
]
=
$this
->
id
;
$agents_data
[
'level'
]
=
20
;
$agents
->
editData
(
$agents_data
,
$agents_id
,
'id'
);
}
else
{
$this
->
save
(
$store_data
,
[
'id'
=>
$data
[
'id'
]]);
$resutlt
=
$agents_id
;
$store_agents_id
=
$agents
->
where
([
'store_id'
=>
$data
[
'id'
],
'level'
=>
20
])
->
value
(
'id'
);
if
(
$store_agents_id
!=
$agents_id
)
{
$update_agents
[
0
][
'id'
]
=
$store_agents_id
;
$update_agents
[
0
][
'level'
]
=
10
;
$update_agents
[
1
][
'id'
]
=
$agents_id
;
$update_agents
[
1
][
'level'
]
=
20
;
$agents
->
saveAll
(
$update_agents
);
}
}
return
$resutlt
;
}
/**
* 通过id获取门店信息
*
* @param $id
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getStoreById
(
$id
)
{
$data
=
$this
->
where
(
'id'
,
$id
)
->
where
(
'status'
,
0
)
->
find
();
$agents
=
new
AAgents
();
$agents_name
=
$agents
->
field
(
'id,name,phone'
)
->
where
(
'store_id'
,
$data
[
'id'
])
->
where
(
'level'
,
20
)
->
find
();
$data
[
'agents_id'
]
=
$agents_name
[
'id'
];
$data
[
'agents_name'
]
=
$agents_name
[
'name'
]
.
'-'
.
$agents_name
[
'phone'
];
return
$data
;
}
}
\ No newline at end of file
application/model/JournalAccounts.php
View file @
bb3923bb
...
@@ -48,6 +48,7 @@ class JournalAccounts extends Model
...
@@ -48,6 +48,7 @@ class JournalAccounts extends Model
$result
=
$this
->
db
->
field
(
$field
)
->
alias
(
'j'
)
$result
=
$this
->
db
->
field
(
$field
)
->
alias
(
'j'
)
->
join
(
'applies a'
,
'j.apply_id = a.id'
,
'LEFT'
)
->
join
(
'applies a'
,
'j.apply_id = a.id'
,
'LEFT'
)
->
where
(
'a.agent_id'
,
$agent_id
)
->
where
(
'a.agent_id'
,
$agent_id
)
->
where
(
$params
)
->
group
(
'j.apply_id'
)
->
group
(
'j.apply_id'
)
->
limit
(
$pageSize
)
->
limit
(
$pageSize
)
->
order
(
$order_
)
->
order
(
$order_
)
...
...
application/model/Regions.php
View file @
bb3923bb
...
@@ -48,19 +48,24 @@ class Regions extends Model
...
@@ -48,19 +48,24 @@ class Regions extends Model
public
function
getRegionsCodeByName
(
$province
,
$city
=
''
,
$disc
=
''
)
{
public
function
getRegionsCodeByName
(
$province
,
$city
=
''
,
$disc
=
''
)
{
if
(
$province
)
{
if
(
$province
)
{
$result
[
'province_code'
]
=
$this
->
where
(
'parentCode'
,
100000
)
$result
[
'province_code'
]
=
$this
->
where
(
'parentCode'
,
100000
)
->
where
(
'
n
ame'
,
'LIKE'
,
$province
.
'%'
)
->
value
(
'code'
);
->
where
(
'
fullN
ame'
,
'LIKE'
,
$province
.
'%'
)
->
value
(
'code'
);
if
(
$result
[
'province_code'
]
&&
$city
)
{
if
(
$result
[
'province_code'
]
&&
$city
)
{
$result
[
'city_code'
]
=
$this
->
where
(
'parentCode'
,
$result
[
'province_code'
])
$result
[
'city_code'
]
=
$this
->
where
(
'parentCode'
,
$result
[
'province_code'
])
->
where
(
'
n
ame'
,
'LIKE'
,
$city
.
'%'
)
->
value
(
'code'
);
->
where
(
'
fullN
ame'
,
'LIKE'
,
$city
.
'%'
)
->
value
(
'code'
);
if
(
$disc
)
{
if
(
$disc
)
{
$result
[
'disc_code'
]
=
$this
->
where
(
'parentCode'
,
$result
[
'city_code'
])
$result
[
'disc_code'
]
=
$this
->
where
(
'parentCode'
,
$result
[
'city_code'
])
->
where
(
'
n
ame'
,
'LIKE'
,
$disc
.
'%'
)
->
value
(
'code'
);
->
where
(
'
fullN
ame'
,
'LIKE'
,
$disc
.
'%'
)
->
value
(
'code'
);
}
}
}
}
}
}
return
$result
;
return
$result
;
}
}
public
function
getCity
()
{
$city
=
$this
->
where
(
'type'
,
2
)
->
select
();
return
$city
;
}
}
}
application/model/Remarks.php
View file @
bb3923bb
...
@@ -6,5 +6,46 @@ use think\Model;
...
@@ -6,5 +6,46 @@ use think\Model;
class
Remarks
extends
Model
class
Remarks
extends
Model
{
{
//
/**
* 成交记录列表
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param $field
* @param $params
* @param string $agent_id
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getJournalHouseInfo
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'j.id desc'
,
$field
,
$params
)
{
$data
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'houseinfos b'
,
'houseinfos b ON a.house_id = b.id'
,
'LEFT'
)
->
where
(
$params
)
->
group
(
'j.apply_id'
)
->
limit
(
$pageSize
)
->
order
(
$order_
)
->
page
(
$pageNo
)
->
select
();
//查找商铺或街铺的名字和图片
foreach
(
$data
as
$key
=>
$value
)
{
$data
[
$key
]
=
Db
::
table
(
'journalaccounts'
)
->
field
(
'singntime'
)
->
where
(
'apply_id'
,
$value
[
'apply_id'
])
->
find
();
$data
[
$key
][
'singntime'
]
=
date
(
'Y-m-d'
,
strtotime
(
$value
[
'singntime'
]));
$img
=
Db
::
table
(
'houseimgs'
)
->
field
(
'imagename'
)
->
where
(
'house_id'
,
$value
[
'house_id'
])
->
where
(
'imgtype'
,
1
)
->
find
();
if
(
$img
[
'imagename'
])
{
$data
[
$key
][
'img'
]
=
ADMIN_URL_TL
.
'/houseImg/'
.
$img
[
'imagename'
];
}
else
{
$data
[
$key
][
'img'
]
=
ADMIN_URL_TL
.
'/resource/image/pzz_.jpg'
;
}
}
return
$data
;
}
}
}
application/route.php
View file @
bb3923bb
...
@@ -118,6 +118,7 @@ Route::group('index', [
...
@@ -118,6 +118,7 @@ Route::group('index', [
'houseEdit'
=>
[
'index/Houses/edit'
,
[
'method'
=>
'get|post'
]],
//编辑商铺
'houseEdit'
=>
[
'index/Houses/edit'
,
[
'method'
=>
'get|post'
]],
//编辑商铺
'houseDel'
=>
[
'index/Houses/del'
,
[
'method'
=>
'post'
]],
//删除商铺
'houseDel'
=>
[
'index/Houses/del'
,
[
'method'
=>
'post'
]],
//删除商铺
'regions'
=>
[
'index/BusinessDistrict/regions'
,
[
'method'
=>
'get'
]],
//获取省市区数据
'regions'
=>
[
'index/BusinessDistrict/regions'
,
[
'method'
=>
'get'
]],
//获取省市区数据
'getCity'
=>
[
'index/BusinessDistrict/getCity'
,
[
'method'
=>
'get'
]],
//获取所有的城市
'getHouseList'
=>
[
'index/houses/getHouseList'
,
[
'method'
=>
'get'
]],
//楼盘列表
'getHouseList'
=>
[
'index/houses/getHouseList'
,
[
'method'
=>
'get'
]],
//楼盘列表
'carefullyChosen'
=>
[
'index/houses/carefullyChosen'
,
[
'method'
=>
'post'
]],
//设置精选楼盘
'carefullyChosen'
=>
[
'index/houses/carefullyChosen'
,
[
'method'
=>
'post'
]],
//设置精选楼盘
'editExclusive'
=>
[
'index/houses/editExclusive'
,
[
'method'
=>
'post'
]],
//添加和编辑楼盘独家
'editExclusive'
=>
[
'index/houses/editExclusive'
,
[
'method'
=>
'post'
]],
//添加和编辑楼盘独家
...
@@ -126,9 +127,10 @@ Route::group('index', [
...
@@ -126,9 +127,10 @@ Route::group('index', [
'getDistrictList'
=>
[
'index/district/getDistrictList'
,[
'method'
=>
'get'
]],
//总监列表
'getDistrictList'
=>
[
'index/district/getDistrictList'
,[
'method'
=>
'get'
]],
//总监列表
'districtList'
=>
[
'index/district/districtList'
,[
'method'
=>
'get'
]],
//总监列表
'districtList'
=>
[
'index/district/districtList'
,[
'method'
=>
'get'
]],
//总监列表
'adddistrict'
=>
[
'index/district/addDistrict'
,[
'method'
=>
'post'
]],
//添加部门,绑定总监关系
'adddistrict'
=>
[
'index/district/addDistrict'
,[
'method'
=>
'post'
]],
//添加部门,绑定总监关系
'getDistrictListByName'
=>
[
'index/district/getDistrictListByName'
,[
'method'
=>
'get'
]],
//查询部门
'storeList'
=>
[
'index/Store/index'
,[
'method'
=>
'get'
]],
//门店列表
'storeList'
=>
[
'index/Store/index'
,[
'method'
=>
'get'
]],
//门店列表
'addStore'
=>
[
'index/Store/addStore'
,[
'method'
=>
'get'
]],
//添加门店
'addStore'
=>
[
'index/Store/addStore'
,[
'method'
=>
'get
|post
'
]],
//添加门店
'get
DistrictListByName'
=>
[
'index/broker/getDistrictListByName'
,[
'method'
=>
'get'
]],
//添加门店
'get
StoreById'
=>
[
'index/Store/getStoreById'
,[
'method'
=>
'get'
]],
//通过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