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
b834527d
Commit
b834527d
authored
Jul 20, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
cf388545
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
35 deletions
+25
-35
AppChat.php
application/chat/controller/AppChat.php
+18
-17
ChatMsg.php
application/model/ChatMsg.php
+7
-7
OrderModel.php
application/model/OrderModel.php
+0
-11
No files found.
application/chat/controller/AppChat.php
View file @
b834527d
...
@@ -149,16 +149,16 @@ class AppChat extends Basic
...
@@ -149,16 +149,16 @@ class AppChat extends Basic
{
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
/* $params = array(
/* $params = array(
'user_name' => 'cesh',
'user_name' => 'cesh',
'msg_content' => 'ceshi666',
'msg_content' => 'ceshi666',
'target_type' => 'users',
'target_type' => 'users',
'source' => '1',
'source' => '1',
'from' => 'user_1',
'from' => 'user_1',
'type' => '1',
'type' => '1',
'is_user' => '0',
'is_user' => '0',
'target' => 'agent_5739',
'target' => 'agent_5739',
);*/
);*/
$checkResult
=
$this
->
validate
(
$params
,
"ChatVerifyValidate.pushMsg"
);
$checkResult
=
$this
->
validate
(
$params
,
"ChatVerifyValidate.pushMsg"
);
if
(
true
!==
$checkResult
)
{
if
(
true
!==
$checkResult
)
{
...
@@ -193,16 +193,17 @@ class AppChat extends Basic
...
@@ -193,16 +193,17 @@ class AppChat extends Basic
public
function
getChatHistory
()
public
function
getChatHistory
()
{
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
/* $params = array(
'target_type' => 'users', // 消息类型 users 用户消息。chatgroups: 群消息,chatrooms: 聊天室消息
'from' => 'agent_5740', //发送人
'target' => 'agent_5741', //接受人
'page_no' => '1', //第几页
'page_size' => '15' //每页多少条
);*/
if
(
!
isset
(
$params
[
'target_type'
])
||
!
isset
(
$params
[
'from'
])
||
!
isset
(
$params
[
'target'
]))
{
if
(
!
isset
(
$params
[
'target_type'
])
||
!
isset
(
$params
[
'from'
])
||
!
isset
(
$params
[
'target'
]))
{
return
$this
->
response
(
ErrorCodeConst
::
ERROR_CODE_PARAM_NOT_EXIST
,
"请求参数错误"
);
return
$this
->
response
(
ErrorCodeConst
::
ERROR_CODE_PARAM_NOT_EXIST
,
"请求参数错误"
);
}
}
/* $params = array(
'target_type' => 'users', // 消息类型 users 用户消息。chatgroups: 群消息,chatrooms: 聊天室消息
'from' => 'app_64', //发送人
'target' => '18112347151', //接受人
'page_no' => '1', //第几页
'page_size' => '15' //每页多少条
);*/
$page_no
=
empty
(
$params
[
'page_no'
])
?
1
:
$params
[
'page_no'
];
$page_no
=
empty
(
$params
[
'page_no'
])
?
1
:
$params
[
'page_no'
];
$page_size
=
empty
(
$params
[
'page_size'
])
?
15
:
$params
[
'page_size'
];
$page_size
=
empty
(
$params
[
'page_size'
])
?
15
:
$params
[
'page_size'
];
...
...
application/model/ChatMsg.php
View file @
b834527d
...
@@ -74,7 +74,7 @@ class ChatMsg extends Model
...
@@ -74,7 +74,7 @@ class ChatMsg extends Model
->
limit
(
$page_size
)
->
limit
(
$page_size
)
->
page
(
$page_no
)
->
page
(
$page_no
)
->
select
();
->
select
();
//echo $this->getLastSql();
//
echo $this->getLastSql();
return
$data
;
return
$data
;
}
}
...
@@ -86,12 +86,12 @@ class ChatMsg extends Model
...
@@ -86,12 +86,12 @@ class ChatMsg extends Model
//$where_or["a.to_id"] = $params["from"];
//$where_or["a.to_id"] = $params["from"];
}
}
if
(
isset
(
$params
[
"from_id"
]))
{
if
(
isset
(
$params
[
"from_id"
]))
{
$where_
[
"a.from_id"
]
=
$params
[
"from_id"
];
$where_
[
"a.from_id"
]
=
$params
[
"from_id"
];
//$where_or["a.from_id"] = $params["target"];
//$where_or["a.from_id"] = $params["target"];
}
}
if
(
isset
(
$params
[
"id"
]))
{
if
(
isset
(
$params
[
"id"
]))
{
$where_
[
"a.id"
]
=
$params
[
"id"
];
$where_
[
"a.id"
]
=
$params
[
"id"
];
// $where_or["a.id"] = $params["id"];
// $where_or["a.id"] = $params["id"];
}
}
$where_
[
"a.is_del"
]
=
0
;
$where_
[
"a.is_del"
]
=
0
;
...
@@ -99,9 +99,9 @@ class ChatMsg extends Model
...
@@ -99,9 +99,9 @@ class ChatMsg extends Model
->
alias
(
"a"
)
->
alias
(
"a"
)
->
join
(
'chat_msg_ext b'
,
'a.id = b.msg_id'
,
'LEFT'
)
->
join
(
'chat_msg_ext b'
,
'a.id = b.msg_id'
,
'LEFT'
)
->
where
(
$where_
)
->
where
(
$where_
)
/* ->whereOr(function ($query) use ($where_or) {
/* ->whereOr(function ($query) use ($where_or) {
$query->where($where_or);
$query->where($where_or);
})*/
})*/
->
order
(
"a.created_at desc"
)
->
order
(
"a.created_at desc"
)
->
count
();
->
count
();
return
$data
;
return
$data
;
...
...
application/model/OrderModel.php
View file @
b834527d
...
@@ -104,16 +104,6 @@ class OrderModel extends Model
...
@@ -104,16 +104,6 @@ class OrderModel extends Model
public
function
searchOrder
(
$field
,
$params
,
$where_
)
public
function
searchOrder
(
$field
,
$params
,
$where_
)
{
{
/* $result = $this->db_
->field($field)
->alias("a")
->join("o_report b","a.f_id = b.id","left")
->union('SELECT '.$field.' FROM o_order a left join o_report b on a.f_id = b.id where '.$params)
->where($params)
->select();*/
/* dump($params);
dump($where_);*/
//$where_ = $where_ ." and " . $params;
$sql
=
"SELECT * FROM
$sql
=
"SELECT * FROM
(
(
(
(
...
@@ -137,7 +127,6 @@ class OrderModel extends Model
...
@@ -137,7 +127,6 @@ class OrderModel extends Model
)
)
) AS aaa order by aaa.id desc"
;
) AS aaa order by aaa.id desc"
;
$result
=
$this
->
db_
->
query
(
$sql
);
$result
=
$this
->
db_
->
query
(
$sql
);
//echo $this->db_->getLastSql();
return
$result
;
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