From 5cb6bc88a2e75988f4195bebf117ef2caaf84cbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Mon, 15 Mar 2021 15:34:54 +0800 Subject: [PATCH] Update RebateCurrentService.php --- app/data/service/RebateCurrentService.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/data/service/RebateCurrentService.php b/app/data/service/RebateCurrentService.php index 2c0d8a0b1..bb19ec927 100644 --- a/app/data/service/RebateCurrentService.php +++ b/app/data/service/RebateCurrentService.php @@ -61,6 +61,19 @@ class RebateCurrentService extends Service */ private $table = 'DataUserRebate'; + /** + * 返利服务初始化 + * @return void + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + protected function initialize() + { + // 返利奖励到账时机 + $this->status = $this->config('settl_type') > 1 ? 0 : 1; + } + /** * 获取奖励名称 * @param string $prize @@ -128,8 +141,6 @@ class RebateCurrentService extends Service $this->from2 = $this->app->db->name('DataUser')->where($map)->find(); if (empty($this->from2)) throw new Exception('间接推荐人不存在'); } - // 返利奖励到账时机 - $this->status = $this->config('settl_type') > 1 ? 0 : 1; // 批量发放配置奖励 foreach (self::PRIZES as $vo) { if (method_exists($this, $vo['func'])) {