コード例 #1
0
ファイル: BillController.php プロジェクト: vikrantd/easytest
 public function getdata($sku, $c_id)
 {
     $response = array();
     $companyproducts = EeCompanyProduct::find()->joinWith(array('c' => function ($q) {
         $q->from('ee_company ec');
     }))->joinWith(array('product'))->where('sku = :abc AND ec.c_id = :cid', array(':abc' => $sku, ':cid' => $c_id))->limit(10)->all();
     if ($companyproducts) {
         $bills = EeCompanyBillDetails::find()->joinWith(array('companyBill' => function ($q) {
             $q->from('ee_company_bills');
         }))->joinWith('eeReturnHistories')->where('merchant_c_id = :cid AND product_id = :pi AND inventory_status_id IN (1,6)', array(':cid' => $companyproducts[0]->c_id, ':pi' => $companyproducts[0]['product_id']))->all();
         if ($bills) {
             $response['Available_Inventory'] = count($bills);
             $response['Company'] = $companyproducts[0]->c['companyname'];
             $response['Product Model'] = $companyproducts[0]->product['model_no'];
             $response['Product Description'] = $companyproducts[0]->product['description'];
             $response['Product MRP'] = $companyproducts[0]->product['mrp'];
             $response['Bill Id'] = $bills;
             $response['CP'] = $companyproducts[0];
             $response['Product'] = $companyproducts[0]->product;
         } else {
             $response['Available_Inventory'] = 0;
             $response['Company'] = $companyproducts[0]->c['companyname'];
             $response['Product Model'] = $companyproducts[0]->product['model_no'];
             $response['Product Description'] = $companyproducts[0]->product['description'];
             $response['Product MRP'] = $companyproducts[0]->product['mrp'];
             $response['CP'] = $companyproducts[0];
             $response['Product'] = $companyproducts[0]->product;
         }
     } else {
         $response['Error'] = 'No product found';
     }
     return $response;
 }
コード例 #2
0
ファイル: EeBrands.php プロジェクト: vikrantd/easytest
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getEeCompanyBillDetails()
 {
     return $this->hasMany(EeCompanyBillDetails::className(), ['brand_id' => 'brand_id']);
 }
コード例 #3
0
ファイル: EeReturnHistory.php プロジェクト: vikrantd/easytest
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getBillItem()
 {
     return $this->hasOne(EeCompanyBillDetails::className(), ['id' => 'bill_item_id']);
 }
コード例 #4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getEeCompanyBillDetails()
 {
     return $this->hasMany(EeCompanyBillDetails::className(), ['inventory_status_id' => 'id']);
 }
コード例 #5
0
ファイル: EeSuborders.php プロジェクト: vikrantd/easytest
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getEeCompanyBillDetails()
 {
     return $this->hasMany(EeCompanyBillDetails::className(), ['marketplaces_order_id' => 'id']);
 }