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
0194976d
Commit
0194976d
authored
Aug 28, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
11
parent
5294359e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
76 additions
and
9 deletions
+76
-9
MPushMessage.php
application/model/MPushMessage.php
+76
-9
No files found.
application/model/MPushMessage.php
View file @
0194976d
...
...
@@ -13,7 +13,7 @@ use think\Db;
class
MPushMessage
{
protected
$table
=
"
o_bargain
"
;
protected
$table
=
"
m_push_message
"
;
private
$db_
;
public
function
__construct
()
...
...
@@ -21,6 +21,46 @@ class MPushMessage
$this
->
db_
=
Db
::
name
(
$this
->
table
);
}
/**
* @param $data
* @param $operation_id
* @param $type
* @return bool
*/
public
function
addData
(
$data
,
$operation_id
,
$type
)
{
if
(
isset
(
$data
[
'agent_id'
]))
{
$insert_data
[
'addressee_id'
]
=
$data
[
'agent_id'
];
}
if
(
isset
(
$data
[
'house_id'
]))
{
$insert_data
[
'house_id'
]
=
$data
[
'house_id'
];
}
if
(
isset
(
$data
[
'message'
]))
{
$insert_data
[
'message'
]
=
$data
[
'message'
];
}
if
(
isset
(
$data
[
'user_id'
]))
{
$insert_data
[
'user_id'
]
=
$data
[
'user_id'
];
}
if
(
isset
(
$data
[
'addressee_id'
]))
{
$insert_data
[
'addressee_id'
]
=
$data
[
'addressee_id'
];
}
$insert_data
[
'type'
]
=
$type
;
$insert_data
[
'status'
]
=
0
;
$insert_data
[
'operation_id'
]
=
$operation_id
;
$num
=
$this
->
db_
->
insert
(
$insert_data
);
if
(
$num
>
0
)
{
$result
=
true
;
}
else
{
$result
=
false
;
}
return
$result
;
}
/**
* 根据楼盘id批量插入数据
*
...
...
@@ -28,12 +68,11 @@ class MPushMessage
* @param int $operation_id 操作人id
* @param int $type 消息类型:0群推 1商铺下架 2修改客方 3盘方修改
* @param $data
* @return
int|string
* @return
bool
*/
public
function
addHouseIdArray
(
array
$house_id
,
int
$operation_id
,
int
$type
,
$data
)
public
function
addHouseIdArray
(
array
$house_id
,
int
$operation_id
=
0
,
int
$type
,
$data
)
{
if
(
is_array
(
$house_id
))
{
if
(
!
is_array
(
$house_id
))
{
return
false
;
}
...
...
@@ -58,7 +97,14 @@ class MPushMessage
$insert_data
[
$k
][
'operation_id'
]
=
$operation_id
;
}
return
$this
->
db_
->
insertAll
(
$insert_data
);
$num
=
$this
->
db_
->
insertAll
(
$insert_data
);
if
(
count
(
$num
)
>
0
)
{
$result
=
true
;
}
else
{
$result
=
false
;
}
return
$result
;
}
/**
...
...
@@ -68,11 +114,11 @@ class MPushMessage
* @param int $operation_id 操作人id
* @param int $type 消息类型:0群推 1商铺下架 2修改客方 3盘方修改
* @param $data
* @return
int|string
* @return
bool
*/
public
function
addAgentIdArray
(
array
$agent_id
,
int
$operation_id
,
int
$type
,
$data
)
{
if
(
is_array
(
$agent_id
))
{
if
(
!
is_array
(
$agent_id
))
{
return
false
;
}
...
...
@@ -97,6 +143,26 @@ class MPushMessage
$insert_data
[
$k
][
'operation_id'
]
=
$operation_id
;
}
return
$this
->
db_
->
insertAll
(
$insert_data
);
$num
=
$this
->
db_
->
insertAll
(
$insert_data
);
if
(
count
(
$num
)
>
0
)
{
$result
=
true
;
}
else
{
$result
=
false
;
}
return
$result
;
}
public
function
selectAgentHouse
(
$house_id
)
{
$m_house
=
new
GHousesToAgents
();
$where
[
'a.house_id'
]
=
$house_id
;
$result
=
$m_house
->
getHouseAgent
(
'agents_id'
,
$where
);
$data
=
[];
if
(
$result
[
'status'
]
!=
'fail'
)
{
$data
=
$result
[
'data'
];
}
return
$data
;
}
}
\ 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