1.提交缺失的东西

This commit is contained in:
2025-05-18 17:17:10 +08:00
parent 49beb4ee65
commit 6a2f35fa31
5 changed files with 506 additions and 2 deletions

View File

@ -0,0 +1,77 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\adminapi\lists;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\Goods;
use app\common\lists\ListsSearchInterface;
/**
* Goods列表
* Class GoodsLists
* @package app\adminapi\lists
*/
class GoodsLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author likeadmin
* @date 2025/05/08 15:34
*/
public function setSearch(): array
{
return [
'=' => ['name', 'code', 'first_category_id', 'second_category_id', 'third_category_id', 'brand_id', 'supplier_id', 'status', 'image', 'video', 'poster', 'remark', 'content', 'sort', 'sales_sum', 'virtual_sales_sum', 'click_count', 'virtual_click', 'spec_type', 'max_price', 'min_price', 'market_price', 'stock', 'stock_warn', 'is_show_stock', 'free_shipping_type', 'free_shipping', 'free_shipping_template_id', 'is_commission', 'first_ratio', 'second_ratio', 'three_ratio', 'is_share_bouns', 'region_ratio', 'shareholder_ratio', 'is_new', 'is_best', 'is_like', 'is_team', 'is_integral', 'is_member', 'give_integral_type', 'give_integral', 'del', 'is_express', 'is_selffetch'],
];
}
/**
* @notes 获取列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author likeadmin
* @date 2025/05/08 15:34
*/
public function lists(): array
{
return Goods::where($this->searchWhere)
->field(['id', 'name', 'code', 'first_category_id', 'second_category_id', 'third_category_id', 'brand_id', 'supplier_id', 'status', 'image', 'video', 'poster', 'remark', 'content', 'sort', 'sales_sum', 'virtual_sales_sum', 'click_count', 'virtual_click', 'spec_type', 'max_price', 'min_price', 'market_price', 'stock', 'stock_warn', 'is_show_stock', 'free_shipping_type', 'free_shipping', 'free_shipping_template_id', 'is_commission', 'first_ratio', 'second_ratio', 'three_ratio', 'is_share_bouns', 'region_ratio', 'shareholder_ratio', 'is_new', 'is_best', 'is_like', 'is_team', 'is_integral', 'is_member', 'give_integral_type', 'give_integral', 'del', 'is_express', 'is_selffetch'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取数量
* @return int
* @author likeadmin
* @date 2025/05/08 15:34
*/
public function count(): int
{
return Goods::where($this->searchWhere)->count();
}
}