quanwei
18 hours ago c441dea81bd86bdfb12dff35821fed51f4cc91c2
admin/app/supplier/model/product/Category.php
@@ -4,7 +4,7 @@
use think\facade\Cache;
use app\common\model\product\Category as CategoryModel;
use app\supplier\model\supplier\Supplier as SupplierModel;
/**
 * 商品分类模型
 */
@@ -17,8 +17,13 @@
    {
        $model = new static;
        if (!Cache::get('category_supplier_' . $shop_supplier_id)) {
            $supplier=(new SupplierModel)->detail($shop_supplier_id);
            $where=[$shop_supplier_id]
            if($supplier['is_newcomer']||$supplier['is_repurchase']||$supplier['is_vip']){
                $where=[0,$shop_supplier_id]
            }
            $data = $model->with(['images'])
                ->where('shop_supplier_id','in',[0,$shop_supplier_id])
                ->where('shop_supplier_id','in',$where)
                ->order(['sort' => 'asc', 'create_time' => 'asc'])->select();
            $all = !empty($data) ? $data->toArray() : [];
            $tree = [];