mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-24 10:22:32 +08:00
Update RebateCurrentService.php
This commit is contained in:
parent
5402cae0dc
commit
be9d374b7b
@ -84,18 +84,19 @@ class RebateCurrentService extends Service
|
|||||||
$map = ['id' => $this->order['uid'], 'deleted' => 0];
|
$map = ['id' => $this->order['uid'], 'deleted' => 0];
|
||||||
$this->user = $this->app->db->name('DataUser')->where($map)->find();
|
$this->user = $this->app->db->name('DataUser')->where($map)->find();
|
||||||
if (empty($this->user)) throw new Exception('用户不存在');
|
if (empty($this->user)) throw new Exception('用户不存在');
|
||||||
// 获取推荐用户
|
// 获取直接推荐人数据
|
||||||
if ($this->order['puid1'] > 0) {
|
if ($this->order['puid1'] > 0) {
|
||||||
$map = ['id' => $this->order['puid1']];
|
$map = ['id' => $this->order['puid1']];
|
||||||
$this->from1 = $this->app->db->name('DataUser')->where($map)->find();
|
$this->from1 = $this->app->db->name('DataUser')->where($map)->find();
|
||||||
if (empty($this->from1)) throw new Exception('直接推荐人不存在');
|
if (empty($this->from1)) throw new Exception('直接推荐人不存在');
|
||||||
}
|
}
|
||||||
|
// 获取间接推荐人数据
|
||||||
if ($this->order['puid2'] > 0) {
|
if ($this->order['puid2'] > 0) {
|
||||||
$map = ['id' => $this->order['puid2']];
|
$map = ['id' => $this->order['puid2']];
|
||||||
$this->from2 = $this->app->db->name('DataUser')->where($map)->find();
|
$this->from2 = $this->app->db->name('DataUser')->where($map)->find();
|
||||||
if (empty($this->from2)) throw new Exception('间接推荐人不存在');
|
if (empty($this->from2)) throw new Exception('间接推荐人不存在');
|
||||||
}
|
}
|
||||||
// 批量发放奖励
|
// 批量发放配置奖励
|
||||||
foreach (self::PRIZES as $vo) {
|
foreach (self::PRIZES as $vo) {
|
||||||
if (method_exists($this, $vo['func'])) {
|
if (method_exists($this, $vo['func'])) {
|
||||||
$this->{$vo['func']}();
|
$this->{$vo['func']}();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user