Commit b834527d authored by clone's avatar clone

bug

parent cf388545
...@@ -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'];
......
...@@ -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;
......
...@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment