李忠征信平台后端管理系统
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.

41 lines
1.0 KiB

2 months ago
<?php
namespace app\admin\model;
use think\Model;
use traits\model\SoftDelete;
class Order extends Model
{
use SoftDelete;
// 表名
protected $name = 'order';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'integer';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = false;
protected $deleteTime = 'deletetime';
// 追加属性
protected $append = [
];
// 查询当前用户是否已经付过费
public function getlist($where, $order, $offset, $limit){
$order = empty($order)?['createtime'=>"desc"]:$order;
$list = $this->field("order_no,title,o.money,paytime,content_id,type")->alias('o')->join('fa_content f','f.id = o.content_id','LEFT')->order($order)
->where($where)
->paginate(['page'=> $offset?? 1,'list_rows' => $limit]);
$result = array("total" => $list->total(), "rows" => $list->items(),"sql"=>$this->fetchSql());
return $result;
}
}