|
@@ -55,22 +55,21 @@ class Index extends Api
|
|
|
}
|
|
|
$admindata = db('admin')->where(['id' => ['in', $userids]])->select();
|
|
|
|
|
|
- var_dump($admindata);
|
|
|
- Db::rollback();
|
|
|
- die;
|
|
|
$upincome =$moenylog= [];
|
|
|
foreach ($admindata as $k => $vl) {
|
|
|
if (isset($temp[$vl['id']])) {
|
|
|
+ $upincome = true;
|
|
|
db("admin")->where('id', $vl['id'])->setInc("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';
|
|
|
+ // 逻辑在这块出错了
|
|
|
+// if ($upincome) {
|
|
|
+// $returndata = '123';
|
|
|
// $this->adminModel->saveAll($upincome);
|
|
|
- $this->moneyLogModel->saveAll($moenylog);
|
|
|
- $this->recordModel->where("id", "<=", $maxId)->where(['status' => 0])->update(['status' => 1]);
|
|
|
- }
|
|
|
+ $this->moneyLogModel->saveAll($moenylog);
|
|
|
+ $this->recordModel->where("id", "<=", $maxId)->where(['status' => 0])->update(['status' => 1]);
|
|
|
+// }
|
|
|
}
|
|
|
Db::commit();
|
|
|
return $returndata;
|