start_time = strtotime('2019-10-01'); $this->end_time = strtotime('2019-10-08'); $this->title = "十月金秋&国庆666书币福利"; $this->product_id = 7498; $this->product = $this->getProduct(); $this->sign_config = [ ['day' => 1, 'bonus' => 50, 'is_strong' => false], ['day' => 2, 'bonus' => 50, 'is_strong' => false], ['day' => 3, 'bonus' => 100, 'is_strong' => true], ['day' => 4, 'bonus' => 50, 'is_strong' => false], ['day' => 5, 'bonus' => 50, 'is_strong' => false], ['day' => 6, 'bonus' => 50, 'is_strong' => false], ['day' => 7, 'bonus' => 266, 'is_strong' => true], ]; $this->redis_key = 'activity_national_day:' . date('Ymd'); $this->is_begin = time() >= $this->start_time; $this->is_end = time() >= $this->end_time; } /** * 获取签到奖励 * @param int $days 累计签到天数 * @return int */ protected function getSignBonusMoney(int $days) { $config = collect($this->sign_config)->where('day', $days)->first(); return $config ? $config['bonus'] : 0; } private function getProduct() { return Product::find($this->product_id); } }