lundi 29 août 2016

Laravel5 whereRaw not working to parameterize column name

I'm trying to build the column sent_storename with my whereRaw statement. But when I try to concatenate the values, the query doesn't work. When I fix the column it works. How can I do this?

$query = $this->model->getQuery()->where('products.environment_hash', $hash )->whereRaw('products.deleted_at is null');
$query->select('sku_config','name', 'stock_quantity', 'color', 'size', 'special_price', DB::raw('(special_price/default_price-1)*100 as profit_mark'));
$query->leftJoin('ads', 'ads.product_id', '=', 'products.id');
$query->whereRaw("products.sent_? = 0", array('storename'));



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire