支付宝接口
This commit is contained in:
@@ -23,7 +23,9 @@ class Sql
|
||||
*
|
||||
* @param $where 条件
|
||||
* @return $this
|
||||
* ['id'=>1] 或者 '`id`=1'
|
||||
* ['id'=>1] 或者 '`id`=1' 尽量不要使用string 因为没有做防sql注入
|
||||
* 多条件查询
|
||||
* ['id'=>['<',100]]
|
||||
*/
|
||||
public function where($where){
|
||||
$this->param = [];
|
||||
@@ -63,10 +65,11 @@ class Sql
|
||||
* 拼装排序条件
|
||||
* @param array $order 排序条件
|
||||
* @return $this
|
||||
* $order='id desc'
|
||||
*/
|
||||
public function order($order = 'id',$type = 'desc'){
|
||||
public function order($order = 'id desc'){
|
||||
if($order){
|
||||
$this->filter .= ' ORDER BY '.$order.' '.$type.' ';
|
||||
$this->filter .= ' ORDER BY '.$order.' ';
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
@@ -76,11 +79,12 @@ class Sql
|
||||
* group by
|
||||
* @param array $order
|
||||
* @return $this
|
||||
* $group=['sex','name']
|
||||
*/
|
||||
public function group($order = []){
|
||||
public function group($group = []){
|
||||
if($order){
|
||||
$this->filter .= ' GROUP BY ';
|
||||
$this->filter .= ' '.implode(' ,',$order).' ';
|
||||
$this->filter .= ' '.implode(' ,',$group).' ';
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
@@ -89,6 +93,8 @@ class Sql
|
||||
* 查询limit
|
||||
* @param string
|
||||
* @return $this
|
||||
* $limit = '100' 限制查询100条
|
||||
* $limit = '2,100' 查询第二页 100条数据
|
||||
*/
|
||||
public function limit($limit = '100'){
|
||||
$this->filter .= ' LIMIT '.$limit.' ';
|
||||
@@ -99,6 +105,7 @@ class Sql
|
||||
* 查询字段
|
||||
* @param string $field
|
||||
* @return $this
|
||||
* $field = 'id,count(1),sub(num)'
|
||||
*/
|
||||
public function field($field = '*'){
|
||||
$this->field = $field;
|
||||
|
||||
Reference in New Issue
Block a user