$sjId, 'time' => $month]); $income = isset($return['amount']) ? $return['amount'] : 0; return $income; } //上个月收入 ssh 2020.2.2 public static function getPreviousMonthIncome($sjId) { $month = date("Ym", mktime(0, 0, 0, date("m") - 1, 1, date("Y"))); $return = StatIncomeMonthClass::getByCondition(['sjId' => $sjId, 'time' => $month]); $income = isset($return['amount']) ? $return['amount'] : 0; return $income; } }