baji/app/common/model/GoodsExtendList.php
2025-03-03 14:47:45 +08:00

72 lines
1.7 KiB
PHP
Executable File

<?php
namespace app\common\model;
use app\common\model\Base;
use think\Model;
class GoodsExtendList extends Base
{
// 设置当前模型对应的完整数据表名称
protected $table = 'goods_extend_list';
/**
* 获取列表
*/
public static function getList($where = [], $field = '*', $order = '', $pageSize = "15")
{
$list = self::where($where)
->field($field)
->order($order)
->paginate(['list_rows' => $pageSize, 'query' => request()->param()]);
$page = $list->render();
$data['list'] = $list->toArray()['data'];
$data['count'] = $list->total();
$data['last_page'] = $list->toArray()['last_page'];
$data['page'] = $page;
return $data;
}
/**
* 获取列表 不分页
*/
public static function getAllList($where = [], $field = '*', $order = '', $limit = '0')
{
$data = self::where($where)
->field($field)
->order($order)
->limit($limit)
->select();
return $data;
}
/**
* 获取单条数据
*/
public static function getInfo($where = [], $field = '*')
{
$data = self::where($where)
->field($field)
->find();
return $data;
}
/**
* 获取奖品扩展集合
*/
public static function getGoodsExtendList($goods_id)
{
$data = self::where('goods_id', '=', $goods_id)->select();
return $data;
}
/**
* 获取奖品扩展集合
*/
public static function getGoodsIdExtendList($goods_list_id)
{
$data = self::where('goods_list_id', '=', $goods_list_id)->find();
return $data;
}
}