修改底层函数
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
/*
|
/*
|
||||||
* @Author: your name
|
* @Author: your name
|
||||||
* @Date: 2020-09-30 17:32:46
|
* @Date: 2020-09-30 17:32:46
|
||||||
* @LastEditTime: 2020-11-16 16:09:31
|
* @LastEditTime: 2020-11-17 15:17:09
|
||||||
* @LastEditors: kangkang
|
* @LastEditors: kangkang
|
||||||
* @Description: In User Settings Edit
|
* @Description: In User Settings Edit
|
||||||
* @FilePath: /phptest/fastphp/base/Model.php
|
* @FilePath: /phptest/fastphp/base/Model.php
|
||||||
@@ -77,9 +77,9 @@ class Model extends Sql
|
|||||||
* @param {*}
|
* @param {*}
|
||||||
* @return {*}
|
* @return {*}
|
||||||
*/
|
*/
|
||||||
public function getNewOne($fields = '*')
|
public function getNewOne($fields = '*',$where = [])
|
||||||
{
|
{
|
||||||
return $this->field($fields)->order('id desc')->fetch();
|
return $this->field($fields)->where($where)->order('id desc')->fetch();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @description: 更新一条数据
|
* @description: 更新一条数据
|
||||||
|
|||||||
@@ -85,6 +85,20 @@ class Sql
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* left join
|
||||||
|
* @param array $order 排序条件
|
||||||
|
* @return $this
|
||||||
|
* $order='id desc'
|
||||||
|
*/
|
||||||
|
public function join($condition = '')
|
||||||
|
{
|
||||||
|
if ($condition) {
|
||||||
|
$this->filter = ' LEFT JOIN ' . $condition . ' ';
|
||||||
|
}
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼装排序条件
|
* 拼装排序条件
|
||||||
* @param array $order 排序条件
|
* @param array $order 排序条件
|
||||||
|
|||||||
Reference in New Issue
Block a user