|
@@ -20,6 +20,7 @@ class Index extends Api
|
|
|
$this->recordModel = new \app\admin\model\greenroom\Record;
|
|
|
$this->adminModel = new \app\admin\model\Admin;
|
|
|
$this->userlinkModel = new \app\admin\model\greenroom\Userlink;
|
|
|
+ $this->moneyLogModel = new \app\common\model\MoneyLog;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -53,15 +54,19 @@ class Index extends Api
|
|
|
$userids[] = $val['id'];
|
|
|
}
|
|
|
$admindata = db('admin')->where(['id' => ['in', $userids]])->select();
|
|
|
- $upincome = [];
|
|
|
+ $upincome =$moenylog= [];
|
|
|
foreach ($admindata as $k => $vl) {
|
|
|
if (isset($temp[$vl['id']])) {
|
|
|
$upincome[] = ['id' => $vl['id'], 'money' => $vl['money'] + $temp[$vl['id']]];
|
|
|
+ $moenylog[]=['user_id'=>$vl['id'],'money' =>$temp[$vl['id']],'before' => $vl['money'], 'after' => $vl['money'] + $temp[$vl['id']], 'memo' => 'upincome'];
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
if ($upincome) {
|
|
|
$returndata = '123';
|
|
|
$this->adminModel->saveAll($upincome);
|
|
|
+ $this->moneyLogModel->saveAll($moenylog);
|
|
|
$this->recordModel->where("id", "<=", $maxId)->where(['status' => 0])->update(['status' => 1]);
|
|
|
}
|
|
|
}
|