whereLike('name', "%" . $value . "%"); } } /** * 根据商品id 获取商品信息 * @param int $productId * @param string $field * @return Product|array|mixed|\think\Model */ public static function getById(int $productId, string $field = '*') { return self::where('id', $productId)->field($field)->findOrEmpty(); } /** * 根据supplier_product_id获取商品信息 * @param int $productId * @param string $field * @return Product|array|mixed|\think\Model */ public static function getBySupplierProductId(int $productId, string $field = '*') { return self::where('supplier_product_id', $productId)->field($field)->findOrEmpty(); } }