基础配置与底层修改
This commit is contained in:
@@ -1,4 +1,12 @@
|
||||
<?php
|
||||
/*
|
||||
* @Descripttion:
|
||||
* @version:
|
||||
* @Author: kangkang
|
||||
* @Date: 2020-09-30 17:32:46
|
||||
* @LastEditors: kangkang
|
||||
* @LastEditTime: 2020-11-12 19:17:36
|
||||
*/
|
||||
|
||||
namespace fastphp\base;
|
||||
|
||||
@@ -30,8 +38,12 @@ class Controller
|
||||
$getPayload=$jwt->verifyToken($token);
|
||||
|
||||
} else {
|
||||
$jwt = new Jwt('etor_yh_lzh_20f_2020_YES');
|
||||
$getPayload=$jwt->verifyToken($_SERVER['HTTP_TOKEN']);
|
||||
if(isset($_SERVER['HTTP_TOKEN'])){
|
||||
$jwt = new Jwt('etor_yh_lzh_20f_2020_YES');
|
||||
$getPayload=$jwt->verifyToken($_SERVER['HTTP_TOKEN']);
|
||||
} else {
|
||||
die;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
* @Author: your name
|
||||
* @Date: 2020-09-30 17:32:46
|
||||
* @LastEditTime: 2020-10-26 10:33:22
|
||||
* @LastEditTime: 2020-11-16 16:09:31
|
||||
* @LastEditors: kangkang
|
||||
* @Description: In User Settings Edit
|
||||
* @FilePath: /phptest/fastphp/base/Model.php
|
||||
@@ -40,6 +40,16 @@ class Model extends Sql
|
||||
return $this->field('count(1) as count')->where($where)->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 获取所有的列表
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
*/
|
||||
public function getList($where = [],$fields = '*', $order = 'id desc')
|
||||
{
|
||||
return $this->field($fields)->where($where)->order($order)->fetchAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* 按照页数获取数据
|
||||
* @param $fields 'id,count(1)...'
|
||||
@@ -59,16 +69,17 @@ class Model extends Sql
|
||||
*/
|
||||
public function getOne($where = [], $fields = '*')
|
||||
{
|
||||
return $this->field($fields)->where($where)->limit('1')->fetch();
|
||||
return $this->field($fields)->where($where)->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description: 获取最新一条数据
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
*/
|
||||
public function getNewOne($fields = '*'){
|
||||
return $this->field($fields)->order('id desc')->limit(1)->fetch();
|
||||
public function getNewOne($fields = '*')
|
||||
{
|
||||
return $this->field($fields)->order('id desc')->fetch();
|
||||
}
|
||||
/**
|
||||
* @description: 更新一条数据
|
||||
|
||||
Reference in New Issue
Block a user