public function search($params) { $query = TransferHdrModel::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere(['id_transfer' => $this->id_transfer, 'id_warehouse_source' => $this->id_warehouse_source, 'id_warehouse_dest' => $this->id_warehouse_dest, 'transfer_date' => $this->transfer_date, 'receive_date' => $this->receive_date, 'status' => $this->status, 'create_by' => $this->create_by, 'update_by' => $this->update_by]); $query->andFilterWhere(['like', 'transfer_num', $this->transfer_num])->andFilterWhere(['like', 'create_date', $this->create_date])->andFilterWhere(['like', 'update_date', $this->update_date]); return $dataProvider; }
/** * @return \yii\db\ActiveQuery */ public function getIdTransfers() { return $this->hasMany(TransferHdr::className(), ['id_transfer' => 'id_transfer'])->viaTable('transfer_dtl', ['id_product' => 'id_product']); }
/** * @return \yii\db\ActiveQuery */ public function getTransferHdrs() { return $this->hasMany(TransferHdr::className(), ['id_warehouse_dest' => 'id_warehouse']); }
/** * @return \yii\db\ActiveQuery */ public function getIdTransfer() { return $this->hasOne(TransferHdr::className(), ['id_transfer' => 'id_transfer']); }