...
|
...
|
@@ -213,7 +213,26 @@ class Common extends Api |
|
|
//清除所有用户积分
|
|
|
public function CleamUserNum()
|
|
|
{
|
|
|
Db::name('user')->where('id', 'neq', 0)->update(['num' => 0]);
|
|
|
$UserArray = Db::name('user')->where('num', 'neq', 0)->select();
|
|
|
if (!empty($UserArray)) {
|
|
|
foreach ($UserArray as $k => $v) {
|
|
|
$data = [
|
|
|
'user_id' => $v['id'],
|
|
|
'num' => $v['num'],
|
|
|
'type' => 3
|
|
|
];
|
|
|
$res = Db::name('num')->insert($data);
|
|
|
if (!$res) {
|
|
|
$this->error('后台操作记录增加失败', 0);
|
|
|
die;
|
|
|
}
|
|
|
$res2 = Db::name('user')->where('id', $v['id'])->update(['num' => 0]);
|
|
|
if (!$res) {
|
|
|
$this->error('用户积分清楚失败', 0);
|
|
|
die;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
$this->success('成功');
|
|
|
}
|
|
|
|
...
|
...
|
|