DB::table('foduu_products as fp' )->select("fp.id", "fp.name", "fp.slug"," fp.status", "fc.name", "fc.slug as category_slug", "fp.approved", "ff.filepath", "fdp.product_id","fdp.type", "fdp.sku", "fdp.regular_price", "fdp.sale_price", "fp.created_at", "fp.updated_at")
->JOIN(foduu_details_product as fdp ,fp.id ,=, fdp.product_id)
->JOIN(foduu_category_product as fcp,fp.id, =,fcp.product_id)
->JOIN(foduu_filemanager as ff,fp.filemanager_id ,=, ff.id)
->JOIN(foduu_categories as fc, fcp.category_id,=, fc.id) ->where(fc.slug, $slug)->where(fp.approved, 1)
->where(fp.status, 1)
->orderBy(sale_price, DESC)->get();
答案 0 :(得分:1)
您应该在所有字符串文字周围添加单引号或双引号。 例如:
->JOIN('foduu_details_product as fdp', 'fp.id','=', 'fdp.product_id')
如果它仍然不起作用,您应该在此处发布错误消息。