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