You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace app\api\controller;
|
|
|
|
|
|
|
|
use app\common\controller\Api;
|
|
|
|
use think\Db;
|
|
|
|
/**
|
|
|
|
* 首页接口
|
|
|
|
*/
|
|
|
|
class Index extends Api
|
|
|
|
{
|
|
|
|
protected $noNeedLogin = ['*'];
|
|
|
|
protected $noNeedRight = ['*'];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 首页
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public function index()
|
|
|
|
{
|
|
|
|
echo "111";
|
|
|
|
exit();
|
|
|
|
$list = Db::name('user')->where('status','normal')->select();
|
|
|
|
foreach ($list as $key => $value) {
|
|
|
|
$amount = Db::name('transaction_record')->where('type',2)->where('user_id', $value['id'])->sum('amount');
|
|
|
|
$ret = Db::name('user')->where('id', $value['id'])->update(['profit_amount' => $amount]);
|
|
|
|
var_dump($ret);
|
|
|
|
}
|
|
|
|
$this->success('请求成功');
|
|
|
|
}
|
|
|
|
}
|