@@ -111,9 +111,9 @@ class MessageOneModel extends \DAO\AbstractModel {
$where=Common::format(" (fromUserId={0} and fromType={1} and toUserId={2} and toType={3}) or (fromUserId={4} and fromType={5} and toUserId={6} and toType={7})",$data['fromUserId'],$data['fromType'],$data['toUserId'],$data['toType'],$data['toUserId'],$data['toType'],$data['fromUserId'],$data['fromType']);
$insertSql=Common::format("insert into {0}(`fromId`,`toUserId`,`toUserName`,`toType`,`fromUserId`,`fromUserName`,`fromType`,`message`,`fromUnReadCount`,`toUnReadCount`,`gmtCreate`,`gmtUpdate`,`toId`) VALUES({1},{2},'{3}',{4},{5},'{6}',{7},'{8}',{9},{10},{11},{12},{13}) ON DUPLICATE KEY UPDATE message='{14}',fromUnReadCount=fromUnReadCount+1,gmtUpdate={15} ",$this->_tableName,$data['toId'],$data['fromUserId'],$data['fromUserName'],$data['fromType'],$data['toId'],$data['toUserName'],$data['toType'],$data['message'],ApiConst::zero,ApiConst::one,TIMESTAMP,TIMESTAMP,$data['toId'],$data['message'],TIMESTAMP);
$insertSql=Common::format("insert into {0}(`fromId`,`toUserId`,`toUserName`,`toType`,`fromUserId`,`fromUserName`,`fromType`,`message`,`fromUnReadCount`,`toUnReadCount`,`gmtCreate`,`gmtUpdate`,`toId`) VALUES({1},{2},'{3}',{4},{5},'{6}',{7},'{8}',{9},{10},{11},{12},{13}) ON DUPLICATE KEY UPDATE message='{14}',fromUnReadCount=fromUnReadCount+1,gmtUpdate={15} ",$this->_tableName,$data['toId'],$data['fromUserId'],$data['fromUserName'],$data['fromType'],$data['toId'],$data['toUserName'],$data['toType'],$data['message'],ApiConst::zero,ApiConst::one,time(),time(),$data['toId'],$data['message'],time());
}else{
$insertSql=Common::format("insert into {0}(`fromId`,`toUserId`,`toUserName`,`toType`,`fromUserId`,`fromUserName`,`fromType`,`message`,`fromUnReadCount`,`toUnReadCount`,`gmtCreate`,`gmtUpdate`,`toId`) VALUES({1},{2},'{3}',{4},{5},'{6}',{7},'{8}',{9},{10},{11},{12},{13}) ON DUPLICATE KEY UPDATE message='{14}',toUnReadCount=toUnReadCount+1,gmtUpdate={15} ",$this->_tableName,$data['fromId'],$data['toUserId'],$data['toUserName'],$data['toType'],$data['fromUserId'],$data['fromUserName'],$data['fromType'],$data['message'],ApiConst::zero,ApiConst::one,TIMESTAMP,TIMESTAMP,$data['toId'],$data['message'],TIMESTAMP);
$insertSql=Common::format("insert into {0}(`fromId`,`toUserId`,`toUserName`,`toType`,`fromUserId`,`fromUserName`,`fromType`,`message`,`fromUnReadCount`,`toUnReadCount`,`gmtCreate`,`gmtUpdate`,`toId`) VALUES({1},{2},'{3}',{4},{5},'{6}',{7},'{8}',{9},{10},{11},{12},{13}) ON DUPLICATE KEY UPDATE message='{14}',toUnReadCount=toUnReadCount+1,gmtUpdate={15} ",$this->_tableName,$data['fromId'],$data['toUserId'],$data['toUserName'],$data['toType'],$data['fromUserId'],$data['fromUserName'],$data['fromType'],$data['message'],ApiConst::zero,ApiConst::one,time(),time(),$data['toId'],$data['message'],time());