支付宝接口
This commit is contained in:
@@ -2,16 +2,17 @@
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\api\model\Test;
|
||||
use app\api\model\User;
|
||||
use fastphp\base\Controller;
|
||||
use app\api\model\Logs;
|
||||
|
||||
class Index
|
||||
class Index extends Controller
|
||||
{
|
||||
|
||||
public function index()
|
||||
{
|
||||
$test = new Test();
|
||||
$list = $test->field('user,operation,record,create_time')->order('id')->limit('50')->fetchAll();
|
||||
$count = $test->field('count(1) as count')->fetch();
|
||||
$logs = new Logs();
|
||||
$list = $logs->getUserListPage('50');
|
||||
$count = $logs->getCount();
|
||||
$data = [
|
||||
'Code'=>10000,
|
||||
'count'=>$count['count'],
|
||||
@@ -27,8 +28,8 @@ class Index
|
||||
die;
|
||||
}
|
||||
$page = ($_GET['page'] - 1) * 50;
|
||||
$test = new Test();
|
||||
$list = $test->limit("$page,50")->fetchAll();
|
||||
$logs = new Logs();
|
||||
$list = $logs->getUserListPage("$page,50");
|
||||
$data = [
|
||||
'Code'=>10000,
|
||||
'data'=>$list
|
||||
|
||||
17
app/api/model/Logs.php
Normal file
17
app/api/model/Logs.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\model;
|
||||
|
||||
use fastphp\base\Model;
|
||||
|
||||
class Logs extends Model
|
||||
{
|
||||
protected $table = 'logs';
|
||||
|
||||
//按照页数获取日志数据
|
||||
public function getUserListPage($page)
|
||||
{
|
||||
return $this->field('user,operation,record,create_time')->order('create_time desc')->limit($page)->fetchAll();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\api\model;
|
||||
|
||||
use fastphp\base\Model;
|
||||
|
||||
class Test extends Model
|
||||
{
|
||||
protected $table = 'test';
|
||||
}
|
||||
Reference in New Issue
Block a user