|
@@ -38,7 +38,7 @@ class SupplierGoods extends Controller
|
|
|
$where[] = ['a.is_deleted','=',0];
|
|
|
if($supplier_id)$where[] = ['a.supplier_id','=',$supplier_id];
|
|
|
if($company_id)$where[] = ['a.company_id','=',$company_id];
|
|
|
- $query = $this->_query($this->table)->where($where)->like('a.name')->field('a.*,b.title supplier_name ,c.title company_name');
|
|
|
+ $query = $this->_query($this->table)->where($where)->like('a.name')->alias('a')->field('a.*,b.title supplier_name ,c.title company_name');
|
|
|
$query->leftJoin('Supplier b','b.id = a.supplier_id')->leftJoin('Company c','c.id = a.company_id');
|
|
|
$query->order(' a.sort desc , a.id desc')->page();
|
|
|
}
|