Commit 76e088d5 authored by christ's avatar christ

pc

parent 6d362fd2
...@@ -72,7 +72,11 @@ class MessageHistoryModel extends \DAO\AbstractModel { ...@@ -72,7 +72,11 @@ class MessageHistoryModel extends \DAO\AbstractModel {
} }
public function updateByFromIdAndSelfTypeAndToIdAndToType($fromId,$fromType,$toId,$toType){ public function updateByFromIdAndSelfTypeAndToIdAndToType($fromId,$fromType,$toId,$toType){
if($fromId!=$toId){
$where=Common::format(" (((fromId={0} and toId={1} and toType={2} and fromType={3}) and status=0))",$toId,$fromId,$fromType,$toType); $where=Common::format(" (((fromId={0} and toId={1} and toType={2} and fromType={3}) and status=0))",$toId,$fromId,$fromType,$toType);
}else{
$where=Common::format(" (((fromId={0} and toId={1} and toType={2} and fromType={3}) and status=0))",$toId,$fromId,$toType,$fromType);
}
$data['status']=ApiConst::read; $data['status']=ApiConst::read;
return $this->updateByWhere($where,$data); return $this->updateByWhere($where,$data);
} }
......
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