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
350192e2
Commit
350192e2
authored
Mar 26, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
进场推送
parent
2f2e0c65
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
9 deletions
+61
-9
OrderLog.php
application/api_broker/controller/OrderLog.php
+18
-0
AAgents.php
application/model/AAgents.php
+22
-7
GHousesToAgents.php
application/model/GHousesToAgents.php
+3
-2
OReportModel.php
application/model/OReportModel.php
+18
-0
No files found.
application/api_broker/controller/OrderLog.php
View file @
350192e2
...
...
@@ -2,11 +2,14 @@
namespace
app\api_broker\controller
;
use
app\api\untils\GeTuiUntils
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\service\OrderLogService
;
use
app\model\AAgents
;
use
app\model\OBargainModel
;
use
app\model\OMarchInModel
;
use
app\model\ORefundModel
;
use
app\model\OReportModel
;
use
think\Exception
;
/**
...
...
@@ -59,7 +62,22 @@ class OrderLog extends Basic
$is_ok
=
$this
->
o_march_in_model
->
addMarchIn
(
$params
);
$is_ok
=
1
;
if
(
$is_ok
>
0
)
{
$ge_tui
=
new
GeTuiUntils
();
$report
=
new
OReportModel
();
$field
=
'house_title,user_name'
;
$report_data
=
$report
->
getReportOrder
(
$field
,
[
'a.id'
=>
$params
[
"report_id"
]]);
$agent
=
new
AAgents
();
$agent_data
=
$agent
->
getAgentInfo
(
'device_id,store_id'
,
$params
[
'reception_id'
]);
$content
=
"客户
{
$report_data
[
'user_name'
]
}
进场【
{
$report_data
[
'house_title'
]
}
】商铺"
;
$where
[
'store_id'
]
=
$agent_data
[
'store_id'
];
$where
[
'level'
]
=
20
;
$agent_store
=
$agent
->
getAgentInfo
(
'id,device_id'
,
''
,
$where
);
$ge_tui
->
public_push_message_for_one
(
$params
[
'reception_id'
],
$agent_data
[
'device_id'
],
'进场'
,
$content
);
$ge_tui
->
public_push_message_for_one
(
$agent_store
[
'reception_id'
],
$agent_store
[
'device_id'
],
'进场'
,
$content
);
return
$this
->
response
(
"200"
,
"request success"
,
[]);
}
else
{
return
$this
->
response
(
"101"
,
"request faild"
);
...
...
application/model/AAgents.php
View file @
350192e2
...
...
@@ -454,29 +454,43 @@ class AAgents extends BaseModel
->
find
();
}
/**
* @param $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
getStoreOrAgentInfo
(
$field
,
$params
){
$result
=
Db
::
table
(
$this
->
table
)
return
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"a_store b"
,
"a.store_id = b.id"
,
"left"
)
->
where
(
$params
)
->
where
(
'a.level'
,[
'='
,
20
],[
'='
,
40
],
'or'
)
->
select
();
return
$result
;
}
/**
/**
* 根据id获取经纪人信息
*
* @param $field
* @param $agent_id
* @param string $where
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAgentInfo
(
$field
,
$agent_id
)
{
return
$this
->
field
(
$field
)
->
where
(
'id'
,
$agent_id
)
public
function
getAgentInfo
(
$field
,
$agent_id
=
''
,
$params
=
''
)
{
if
(
$agent_id
!=
''
)
{
$where
[
'id'
]
=
$agent_id
;
}
else
{
$where
=
$params
;
}
return
$this
->
field
(
$field
)
->
where
(
$where
)
->
find
();
}
}
}
\ No newline at end of file
application/model/GHousesToAgents.php
View file @
350192e2
...
...
@@ -190,10 +190,11 @@ class GHousesToAgents extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
get
Device_id
(
$house_id
,
$type
=
1
)
{
return
$this
->
field
(
'b.id,device_id'
)
public
function
get
AgentList
(
$house_id
,
$type
=
1
)
{
return
$this
->
field
(
'b.id,device_id
,store_name
'
)
->
alias
(
'a'
)
->
join
(
'a_agents b'
,
'a.agents_id = b.id'
,
'left'
)
->
join
(
'a_store c'
,
'b.store_id = c.id'
,
'left'
)
->
where
(
'houses_id'
,
$house_id
)
->
where
(
'type'
,
$type
)
->
select
();
...
...
application/model/OReportModel.php
View file @
350192e2
...
...
@@ -199,4 +199,21 @@ class OReportModel extends Model
->
select
();
}
/**
* 获取报备和订单信息
*
* @param $field
* @param $where
* @return array|false|\PDOStatement|string|Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getReportOrder
(
$field
,
$where
)
{
return
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'o_order b'
,
'b.f_id=a.id'
,
'left'
)
->
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