Hi Guys,
I’ve a very weird situation and can use your help.
In console application building query like this
$query = (new \yii\db\Query());
$query->select(['facility_id','shop_id','product_name','product_category_name','received_from_facility_name','unit_of_measure','cast(sum( quantity) as decimal(20,5)) as quantity'])
->from('vw_product_total_inventory')
->where('facility_id = :facility_id')
->addParams([':facility_id'=> $facility['id']])
->groupBy([
'facility_id',
'shop_id',
'product_name',
'product_id',
'product_category_name',
'received_from_facility_name',
'unit_of_measure']);
$products = $query->all();
runs perfect on local system, but when i deploy to test server i receive this error
Exception 'yii\db\Exception' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'briteside-wp.vw_product_total_inventory' doesn't exist
The SQL being executed was: SELECT `facility_id`, `shop_id`, `product_name`, `product_category_name`, `received_from_facility_name`, `unit_of_measure`, cast(sum( quantity) as decimal(20,5)) as quantity FROM `vw_product_total_inventory` WHERE facility_id = '1' GROUP BY `facility_id`, `shop_id`, `product_name`, `product_id`, `product_category_name`, `received_from_facility_name`, `unit_of_measure`'
100% verified that the vw_product_total_inventory exist.
This is not a table but a view
All help highly appreciated
Peter