Ejemplo n.º 1
0
 /**
  * 更新账户流水变动未读数据
  */
 public function updateUnReadNum($userId, $type)
 {
     if (empty($userId) || empty($type)) {
         return false;
     }
     // 查询是否存在数据
     $unReadData = Model_Fyk_UserUnread::getInstance()->getDataById($userId, $type);
     if (empty($unReadData)) {
         // 插入
         $addArr = array('userId' => $userId, 'unreadNum' => 1, 'type' => $type, 'createTime' => time());
         return Model_Fyk_UserUnread::getInstance()->insertData($addArr);
     } else {
         // 更新
         $keyArr = array('id' => $unReadData['id']);
         $updateArr = array('unreadNum' => $unReadData['unreadNum'] + 1, 'updateTime' => date("Y-m-d H:i:s", time()));
         return Model_Fyk_UserUnread::getInstance()->updateData($keyArr, $updateArr);
     }
 }
Ejemplo n.º 2
0
 /**
  * 更新未读的账目日志信息
  * @param $userId
  * @return bool
  */
 public function updateUnReadNewAmountNum($userId)
 {
     if (empty($userId)) {
         return false;
     }
     $keyData = array('userId' => $userId, 'type' => Model_Fyk_UserUnread::TYTE_AMOUNT);
     $data = array('unreadNum' => 0);
     Model_Fyk_UserUnread::getInstance()->updateData($keyData, $data);
 }
Ejemplo n.º 3
0
 /**
  * 更新失效房源数目未读
  */
 public function updateUnReadInvalidPropNum($userId)
 {
     if (empty($userId)) {
         return false;
     }
     $keyData = array('userId' => $userId, 'type' => Model_Fyk_UserUnread::TYTE_INVALIDPROP);
     $data = array('unreadNum' => 0);
     Model_Fyk_UserUnread::getInstance()->updateData($keyData, $data);
 }