You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
897 B
35 lines
897 B
<?php
|
|
namespace app\Common\model;
|
|
|
|
use app\BaseModel;
|
|
|
|
class LongbingCardCommonModel extends BaseModel
|
|
{
|
|
//定义表名称
|
|
protected $name = 'longbing';
|
|
|
|
public function getRows($table_name,$filter)
|
|
{
|
|
$this->name = $table_name;
|
|
$result = $this->where($filter)->find();
|
|
if(!empty($result)) $result = $result->toArray();
|
|
return $result;
|
|
}
|
|
|
|
public function getCount($table_name ,$filter)
|
|
{
|
|
$this->name = $table_name;
|
|
$result = $this->where($filter)->count();
|
|
return $result;
|
|
}
|
|
|
|
public function listRows($table_name ,$filter ,$field)
|
|
{
|
|
$this->name = $table_name;
|
|
$result = $this->where($filter);
|
|
if(!empty($field)) $result->field($field);
|
|
$result = $result->select();
|
|
if(!empty($result)) $result = $result->toArray();
|
|
return $result;
|
|
}
|
|
} |