添加审核通过状态筛选

This commit is contained in:
wangxiaowei 2024-08-26 11:11:17 +08:00
parent d1357fc659
commit 20005e38b0

@ -25,25 +25,28 @@ class LocalStoreGoodsLogic extends Logic
// 获取商品列表
public static function lists($get)
{
// 1 已上架 2 已下架
if ($get['type'] == 1 || $get['type'] == 2) {
$where[] = ['state', '=', $get['type']];
}
// 待审核
if ($get['type'] == 3) {
$where[] = ['audit_status', '=', self::$AUDIT_STATUS['audit_status_stay']];
}
$where[] = ['lstore_id', '=', $get['lstore_id']];
$where[] = ['lstore_id', '=', 0];
$list = LocalStoreGoods::with('pic')
->field('id, lstore_id, title, price')
->where([
'lstore_id' => $get['lstore_id'],
'state' => $get['type'],
'audit_status' => self::$AUDIT_STATUS['audit_status_ok'],
'delete_time' => 0,
])
->where($where)
->order('id', 'desc')
->page($get['page_no'], $get['page_size'])
->select()
->toArray();
$count = LocalStoreGoods::where([
'lstore_id' => $get['lstore_id'],
'state' => $get['lstore_id'],
'audit_status' => self::$AUDIT_STATUS['audit_status_ok'],
'delete_time' => 0,
])->count();
$count = LocalStoreGoods::where($where)->count();
foreach ($list as &$v) {
foreach ($v['pic'] as &$v1) {