Hello, not sure where to put this.
I have a database table that has several price fields, price1, price2...
After I query the table, I want to access the price field that would be one of those.
The price should be returned as one of the price1, price2 fields.
I tried defining getPrice in the entity class, but get an error when I try to access it using $product->price
Can someone help me with this?
PHP Code:
$data['products'] = $this->product
->select('products.id,name,sku,image,image2,image3,cat_pic,stock,utqg,warranty,price')
->join('categories', 'categories.id = products.category_id')
->where('is_featured', 1)
->where('is_active', 1)
->where('stock >', 0)
->orderBy("stock desc")
->paginate(25);
Unknown column 'price' in 'field list'