Ejemplo n.º 1
0
 /**
  * 判断是否是经纪人和客户第一次聊天
  *
  * @param $brokerId
  * @param $userDeviceId
  * @return bool
  */
 public static function isFirstChat($brokerId, $userDeviceId)
 {
     $chatCount = Model_Mobile_CustomerChatCount::getBrokerCustomerChatCount($brokerId, $userDeviceId);
     return !($chatCount && $chatCount->count > 0);
 }
Ejemplo n.º 2
0
 /**
  * 初始化经纪人发送给客户的微聊统计记录
  *
  * @param $brokerId
  * @param $userDeviceId
  * @param int $count
  *
  * @return Model_Mobile_CustomerChatCount|null
  */
 public static function initBrokerCustomerChatCount($brokerId, $userDeviceId, $count = 0)
 {
     $chatCount = Model_Mobile_CustomerChatCount::create(array('brokerId' => $brokerId, 'userDeviceId' => $userDeviceId, 'count' => $count, 'updateTime' => date('Y-m-d H:i:s')));
     $chatCount->save();
     return $chatCount;
 }