示例#1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Quotation::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['quotation_id' => $this->quotation_id, 'quotation_no' => $this->quotation_no, 'quotation_date' => $this->quotation_date, 'quotation_date_transaction' => $this->quotation_date_transaction, 'quotation_customerid' => $this->quotation_customerid, 'quotation_createid' => $this->quotation_createid, 'quotation_charge' => $this->quotation_charge, 'quotation_tax_percent' => $this->quotation_tax_percent, 'quotation_tax_amount' => $this->quotation_tax_amount, 'quotation_revision' => $this->quotation_revision, 'quotation_parts_total' => $this->quotation_parts_total, 'quotation_gst_payable' => $this->quotation_gst_payable]);
     $query->andFilterWhere(['like', 'quotation_createname', $this->quotation_createname])->andFilterWhere(['like', 'quotation_remark', $this->quotation_remark])->andFilterWhere(['like', 'quotation_system', $this->quotation_system])->andFilterWhere(['like', 'quotation_partno', $this->quotation_partno])->andFilterWhere(['like', 'quotation_invoice', $this->quotation_invoice])->andFilterWhere(['like', 'quotation_deliveryorder', $this->quotation_deliveryorder])->andFilterWhere(['like', 'quotation_tax_label', $this->quotation_tax_label])->andFilterWhere(['like', 'quotation_printed_status', $this->quotation_printed_status])->andFilterWhere(['like', 'quotation_no_user_format', $this->quotation_no_user_format]);
     return $dataProvider;
 }
示例#2
0
 /**
  * Finds the Quotation model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Quotation the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Quotation::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }