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
a03d0458
Commit
a03d0458
authored
Sep 19, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商铺编辑日志记录
parent
22b30a9b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
72 additions
and
45 deletions
+72
-45
Houses.php
application/index/controller/Houses.php
+1
-1
OperationData.php
application/index/controller/OperationData.php
+2
-2
HouseService.php
application/index/service/HouseService.php
+51
-3
houseList.html
application/index/view/houses/houseList.html
+0
-1
GHouses.php
application/model/GHouses.php
+1
-36
GHousesExt.php
application/model/GHousesExt.php
+17
-2
No files found.
application/index/controller/Houses.php
View file @
a03d0458
...
...
@@ -413,7 +413,7 @@ class Houses extends Basic
}
$data
[
'data'
][
'list'
]
=
$this
->
house
->
getHouseListDish
(
$pageNo
,
$pageSize
,
'id DESC'
,
$fields
,
$where
,
$this
->
userId
);
$data
[
'data'
][
'total'
]
=
$this
->
house
->
getHouseList
Dish
Total
(
$where
);
$data
[
'data'
][
'total'
]
=
$this
->
house
->
getHouseListTotal
(
$where
);
$look_shop
=
new
LookShopService
();
...
...
application/index/controller/OperationData.php
View file @
a03d0458
...
...
@@ -128,14 +128,14 @@ class OperationData extends Basic
}
$where
[
'status'
]
=
array
(
'neq'
,
3
);
//排除删除的商铺
// 商铺总量
$house_res
=
$this
->
gHousesModel
->
getHouse
Num
(
$where
);
$house_res
=
$this
->
gHousesModel
->
getHouse
ListTotal
(
$where
);
$result
[
"house_num"
]
=
$house_res
;
// 待租商铺数量
/*$where['residue_num'] = array( 'neq', 0 );
$where['total'] = array( 'neq', 0 );*/
$where
[
'status'
]
=
1
;
$house_res
=
$this
->
gHousesModel
->
getHouse
Num
(
$where
);
$house_res
=
$this
->
gHousesModel
->
getHouse
ListTotal
(
$where
);
$result
[
"have_not_rent_num"
]
=
$house_res
;
return
$this
->
response
(
200
,
'success'
,
$result
);
...
...
application/index/service/HouseService.php
View file @
a03d0458
...
...
@@ -73,17 +73,65 @@ class HouseService
return
$result
;
}
$house_id
=
$this
->
house
->
addHouse
(
$data
,
$agent_id
);
if
(
!
empty
(
$data
[
'id'
]))
{
$house_data
=
$this
->
house
->
getHouseInfo
(
'id,internal_address,internal_title'
,
[
'id'
=>
$data
[
'id'
]]);
if
(
empty
(
$house_data
[
0
][
'id'
]))
{
$result
[
'status'
]
=
'fail'
;
$result
[
'msg'
]
=
'没有该商铺信息'
;
return
$result
;
}
$m_operating
=
new
GOperatingRecords
();
$remark
=
'修改为:剩余铺数'
.
$data
[
'residue_num'
];
if
(
$data
[
'is_exclusive_type'
]
==
1
)
{
$remark
.=
',独家有效期 '
.
$data
[
'agent_start_time'
]
.
'—'
.
$data
[
'agent_end_time'
];
}
$m_operating
->
record
(
$agent_id
,
6
,
$remark
,
$house_id
);
if
(
$data
[
'internal_title'
]
!=
$house_data
[
0
][
'internal_title'
])
{
$remark
.=
',商铺名改为:'
.
$data
[
'internal_title'
];
}
if
(
$data
[
'internal_address'
]
!=
$house_data
[
0
][
'internal_address'
])
{
$remark
.=
',地址改为:'
.
$data
[
'internal_address'
];
}
$house_ext
=
new
GHousesExt
();
$house_data_ext
=
$house_ext
->
getInfo
(
'landlord_phone'
,
[
'house_id'
=>
$data
[
'id'
]]);
if
(
!
empty
(
$house_data_ext
[
'landlord_phone'
]))
{
$landlord_phone_arr
=
$landlord_phone_new_arr
=
$landlord_phone_old
=
[];
$landlord_phone
=
json_decode
(
$house_data_ext
[
'landlord_phone'
],
true
);
if
(
$is_app
==
1
)
{
$landlord_phone_new
=
json_decode
(
$data
[
'landlord_phone'
],
true
);
}
else
{
$landlord_phone_new
=
$data
[
'landlord_phone'
];
}
foreach
(
$landlord_phone
as
$v
)
{
$landlord_phone_arr
[]
=
$v
[
'phone'
];
}
foreach
(
$landlord_phone_new
as
$v2
)
{
$landlord_phone_new_arr
[]
=
$v2
[
'phone'
];
}
foreach
(
$landlord_phone_arr
as
$v3
)
{
if
(
!
empty
(
$v3
)
&&
!
in_array
(
$v3
,
$landlord_phone_new_arr
))
{
$landlord_phone_old
[]
=
$v3
;
}
}
if
(
!
empty
(
$landlord_phone_old
))
{
$remark
.=
',删除房东手机号:'
.
implode
(
','
,
$landlord_phone_old
);
}
}
$m_operating
->
record
(
$agent_id
,
6
,
$remark
,
$data
[
'id'
]);
}
$house_id
=
$this
->
house
->
addHouse
(
$data
,
$agent_id
);
if
(
empty
(
$house_id
))
{
$result
[
'status'
]
=
'fail'
;
$result
[
'msg'
]
=
'新增或编辑商铺失败'
;
...
...
application/index/view/houses/houseList.html
View file @
a03d0458
...
...
@@ -176,7 +176,6 @@
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading breadcrumb"
>
<li><a
href=
"#"
>
商铺列表
</a></li>
<li
class=
"active"
>
新增商铺
</li>
<div
class=
"pull-right"
>
<ul
class=
"bread_btn"
>
<li>
...
...
application/model/GHouses.php
View file @
a03d0458
...
...
@@ -258,8 +258,7 @@ class GHouses extends BaseModel
*/
public
function
getHouseListTotal
(
$params
=
''
)
{
return
$this
->
alias
(
'a'
)
->
where
(
$params
)
return
$this
->
where
(
$params
)
->
count
();
}
...
...
@@ -349,25 +348,6 @@ class GHouses extends BaseModel
return
$result
;
}
/**
* 查询属于盘方的商铺列表总记录数
*
* @param string $params
* @return int|string
*/
public
function
getHouseListDishTotal
(
$params
=
''
)
{
// $data = $this->alias('a')
// ->join('g_houses_to_agents b', 'a.id=b.houses_id', 'left')
// ->join('a_agents c', 'b.agents_id=c.id', 'left')
// ->join('g_houses_ext d', 'a.id=d.house_id', 'left')
// ->where($params)
// ->group('a.id')
// ->count();
// return $data;
return
$this
->
where
(
$params
)
->
count
();
}
/**
* 添加和编辑商铺
*
...
...
@@ -1567,20 +1547,5 @@ class GHouses extends BaseModel
->
select
();
return
$result
;
}
public
function
getHouseNum
(
$params
)
{
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
where
(
$params
)
->
count
();
return
$result
;
}
}
application/model/GHousesExt.php
View file @
a03d0458
...
...
@@ -236,9 +236,9 @@ class GHousesExt extends BaseModel
$ext_id
=
$this
->
where
(
'house_id'
,
$house_id
)
->
value
(
'id'
);
if
(
$ext_id
>
0
)
{
$num
=
$this
->
where
(
'id'
,
$ext_id
)
->
update
(
$save_data
);
$num
=
$this
->
db_
->
where
(
'id'
,
$ext_id
)
->
update
(
$save_data
);
}
else
{
$num
=
$this
->
insert
(
$save_data
);
$num
=
$this
->
db_
->
insert
(
$save_data
);
}
if
(
$num
>
0
)
{
...
...
@@ -249,4 +249,18 @@ class GHousesExt extends BaseModel
return
$result
;
}
/**
* @param $field
* @param $where
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getInfo
(
$field
,
$where
)
{
return
$this
->
db_
->
field
(
$field
)
->
where
(
$where
)
->
find
();
}
}
\ No newline at end of file
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