统计审核失败的商品数量

This commit is contained in:
wangxiaowei 2024-08-27 10:56:00 +08:00
parent dc1377beb6
commit 136cab72d1

@ -28,7 +28,7 @@ class LocalStoreGoodsLogic extends Logic
// 1 已上架 2 已下架
if ($get['type'] == 1 || $get['type'] == 2) {
$where[] = ['state', '=', $get['type']];
$where[] = ['audit_status', '=', self::$AUDIT_STATUS['audit_status_ok']];
$where[] = ['audit_status', '=', self::$AUDIT_STATUS['audit_status_ok']]; // 审核成功
}
// 待审核
@ -36,18 +36,24 @@ class LocalStoreGoodsLogic extends Logic
$where[] = ['audit_status', '=', self::$AUDIT_STATUS['audit_status_stay']];
}
$where[] = ['lstore_id', '=', $get['lstore_id']];
$where[] = ['delete_time', '=', 0];
// 审核失败
if ($get['type'] == 4) {
$where[] = ['audit_status', '=', self::$AUDIT_STATUS['audit_status_refuse']];
}
$m_where[] = ['lstore_id', '=', $get['lstore_id']];
$m_where[] = ['delete_time', '=', 0];
$list = LocalStoreGoods::with('pic')
->field('id, lstore_id, title, price')
->where($where)
->where($m_where)
->order('id', 'desc')
->page($get['page_no'], $get['page_size'])
->select()
->toArray();
$count = LocalStoreGoods::where($where)->count();
$count = LocalStoreGoods::where($where)->where($m_where)->count();
foreach ($list as &$v) {
foreach ($v['pic'] as &$v1) {
@ -55,7 +61,11 @@ class LocalStoreGoodsLogic extends Logic
}
}
// 统计审核失败的商品数量
$fail_goods_count = LocalStoreGoods::where($m_where)->where(['audit_status' => self::$AUDIT_STATUS['audit_status_refuse']])->count();
$result = [
'fail_goods_count' => $fail_goods_count,
'count' => $count,
'lists' => $list,
'more' => is_more($count, $get['page_no'], $get['page_size']),