支付宝接口

This commit is contained in:
wanyongkang
2020-10-11 19:23:42 +08:00
parent ce067b91dc
commit 517b026891
1110 changed files with 139880 additions and 95 deletions

View File

@@ -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
View 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();
}
}

View File

@@ -1,11 +0,0 @@
<?php
namespace app\api\model;
use fastphp\base\Model;
class Test extends Model
{
protected $table = 'test';
}