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
33daad04
Commit
33daad04
authored
Aug 05, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
f1cc3988
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
230 additions
and
0 deletions
+230
-0
Shop.php
application/api_broker/controller/Shop.php
+41
-0
GHousesToAgents.php
application/model/GHousesToAgents.php
+14
-0
GReceiptOperatingRecords.php
application/model/GReceiptOperatingRecords.php
+175
-0
No files found.
application/api_broker/controller/Shop.php
View file @
33daad04
...
...
@@ -728,10 +728,51 @@ class Shop extends Basic
}
}
//独家方
// $result['exclusive_info'] = $this->getExclusiveInfo($result['id'], 3);
//案场权限人
$result
[
'stronghold_info'
]
=
$this
->
getExclusiveInfo
(
$result
[
'id'
]);
unset
(
$result
[
'external_image_id'
]);
return
$this
->
response
(
"200"
,
'request success'
,
$result
);
}
public
function
getExclusiveInfo
(
$house_id
)
{
// $m_agent_house = new GHousesToAgents();
// $exclusive_info = [];
// $params['a.houses_id'] = $house_id;
// $params['a.type'] = $type;
// $params['a.is_del'] = 0;
// $res = $m_agent_house->getAgentsHouses('b.id,name,a.type,b.phone', $params);
// if ($res) {
// $exclusive_info['name'] = $res[0]['name'];
// $exclusive_info['phone'] = $res[0]['phone'];
// } else {
// return null;
// }
// return $exclusive_info ;
$houseToAgentModel
=
new
GHousesToAgents
();
$params
[
"a.houses_id"
]
=
$house_id
;
$params
[
"a.type"
]
=
array
(
"in"
,
'1'
);
//案场权限人,盘方和独家
$params
[
"a.is_del"
]
=
0
;
$house_arr
=
$houseToAgentModel
->
getHouseNameByAgentId
(
"b.name"
,
$params
);
$ids
=
""
;
foreach
(
$house_arr
as
$item
)
{
$ids
.=
$item
[
"name"
]
.
","
;
}
$ids
=
rtrim
(
$ids
,
","
);
if
(
!
$ids
)
{
//代表没有案场
return
null
;
}
return
$ids
;
}
/**
* 是否显示对内地址
* @param $panPartyArr
...
...
application/model/GHousesToAgents.php
View file @
33daad04
...
...
@@ -309,6 +309,20 @@ class GHousesToAgents extends BaseModel
return
$result
;
}
public
function
getHouseNameByAgentId
(
$field
,
$params
)
{
$result
=
Db
::
name
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
'a_agents b'
,
'a.agents_id = b.id'
,
'left'
)
->
where
(
$params
)
->
group
(
"houses_id"
)
->
select
();
//echo Db::name($this->table)->getLastSql();
return
$result
;
}
/**
* @param $field
* @param $params
...
...
application/model/GReceiptOperatingRecords.php
0 → 100755
View file @
33daad04
<?php
namespace
app\model
;
use
think\Db
;
use
think\Model
;
class
GReceiptOperatingRecords
extends
Model
{
// 设置当前模型对应的完整数据表名称
protected
$table
=
'g_receipt_operating_records'
;
private
$db_
;
public
function
__construct
(
$data
=
[])
{
parent
::
__construct
(
$data
);
$this
->
db_
=
Db
::
name
(
$this
->
table
);
}
// public function saveReceiptOperatingRecord($data) {
// $time = date("Y-m-d H:i:s", time());
// $data['create_time'] = $time;
// $data['update_time'] = $time;
// $data['is_del'] = 0;
// return $this->db_ ->insert($data);
// }
//
// /**
// * 查询数据
// */
// public function getReceiptOperatingRecord($field,$params)
// {
// $params["a.is_del"] = 0;
// $result = $this->db_
// ->field($field)
// ->alias('a')
// ->join('u_users b', 'a.user_id = b.id', 'left')
// ->join('a_agents c', 'a.agent_id = c.id', 'left')
// ->where($params)
// ->find();
// //echo $this->getLastSql();
// return $result;
// }
//
// /**
// * 查客方
// * @param $field
// * @param $params
// * @return array|false|\PDOStatement|string|Model
// */
// public function getReceiptOperatingRecordId($field,$params)
// {
// $params["is_del"] = 0;
// $result = $this->db_
// ->field($field)
// ->alias('a')
// ->join('a_agents b', 'a.agent_id = b.id', 'left')
// ->where($params)
// ->select();
// //echo $this->getLastSql();
// return $result;
// }
//
// public function selectReceiptOperatingRecord($field,$params)
// {
// $params["a.is_del"] = 0;
// $result = $this->db_
// ->field($field)
// ->alias('a')
// ->join('u_users b', 'a.user_id = b.id', 'left')
// ->join('a_agents c', 'a.agent_id = c.id', 'left')
// ->join('a_site d', 'a.site_id = d.id', 'left')
// ->where($params)
// ->select();
// //echo $this->getLastSql();
// return $result;
// }
//
// public function selectUser($field,$params)
// {
// $params["is_del"] = 0;
// $result = $this->db_
// ->field($field)
// ->where($params)
// ->select();
// //echo $this->getLastSql();
// return $result;
// }
// /**
// * 更新数据
// */
// public function updateReceiptOperatingRecord($where,$params)
// {
// $result = $this->db_ ->where($where)->update($params);
// //dump($this->getLastSql());
// return $result;
//
// }
//
// /**
// * @param $field
// * @param $params
// * @return array
// */
// public function getReceiptOperatingRecordColumn($field, $params) {
// $params['is_del'] = 0;
// return $this->db_->where($params)
// ->column($field);
// }
//
// /**
// * 统计客方
// * @param $params
// * @return false|\PDOStatement|string|\think\Collection
// * @throws \think\db\exception\DataNotFoundException
// * @throws \think\db\exception\ModelNotFoundException
// * @throws \think\exception\DbException
// */
// public function getAddUserNumGroupTimeNew($params)
// {
// $field = "count(1) as num";
// $where_['is_del'] = 0;
// if (isset($params["agent_id"])) {
// $where_["agent_id"] = $params["agent_id"];
// }
// if (isset($params["create_time"])) {
// $where_["create_time"] = $params["create_time"];
// }
// return $this->db_
// ->field($field)
// ->where($where_)
// ->select();
// }
//
// public function moveHouseInsertAll($data)
// {
// $result = Db::table($this->table)
// ->insertAll($data);
// return $result;
// }
//
// /**
// * @param $field
// * @param $where
// * @return false|\PDOStatement|string|\think\Collection
// */
// public function getAllData($field, $where)
// {
// $where['is_del'] = 0;
// return $this->db_->field($field)
// ->where($where)
// ->select();
// }
//
// public function getAddUserList($params, $field, $page_no, $page_size)
// {
// $where_ = [];
// if (isset($params["agent_id"])) {
// $where_["a.agent_id"] = $params["agent_id"];
// }
// if (isset($params["create_time"])) {
// $where_["a.create_time"] = $params["create_time"];
// }
// $result = $this->db_
// ->field($field)
// ->alias('a')
// ->join('u_users b', 'a.user_id = b.id', 'left')
// ->join('a_agents c', 'a.agent_id = c.id', 'left')
// ->where($where_)
// ->limit($page_size)
// ->page($page_no)
// ->select();
// return $result;
// }
}
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