/**
  * 根据用户id查询账户日志总表2个id之间的数据
  *
  * @param $userId 用户id
  * @param $startId 起始id(包含)
  * @param $endId 结束id(包含)
  * @return array
  * @throws Exception sql或者其他错误
  */
 public function getDifferentBalanceLog($userId, $startId, $endId)
 {
     return Model_Log_AccountBalanceLog::data_access(date('m'))->filter_by_op('userId', '=', $userId)->filter_by_op('id', '>', $startId)->filter_by_op('id', '<=', $endId)->sort('id', 'asc')->find();
 }
 /**
  * 更新账户日志
  * @param $id
  * @param $incrAmount
  * @param $note
  * @param $createdTimeEnd
  * @return mixed
  */
 public static function updateBalanceLogById($id, $incrAmount, $note, $createdTimeEnd)
 {
     try {
         $obj = Model_Log_AccountBalanceLog::data_access(date('m', strtotime($createdTimeEnd)))->force_master()->filter('id', $id)->find_one();
     } catch (Exception $e) {
         return null;
     }
     $obj->amount = $obj->amount + $incrAmount;
     $obj->note = $note;
     $obj->createTimeEnd = $createdTimeEnd;
     $obj->lastUpdate = date('Y-m-d H:i:s');
     return $obj->save();
 }