/var/www/vhosts/nabawater/backend/controllers
NameSizeModeActions
ActivityLogController.php16500644editdlrm
AddressTypeController.php64660644editdlrm
AdminOrderReportController.php35920644editdlrm
AdminUserController.php125230644editdlrm
AdsController.php97430644editdlrm
AreaController.php70190644editdlrm
BannerController.php71000644editdlrm
BranchController.php339890644editdlrm
BranchReviewController.php22090644editdlrm
CashBackPromotionsController.php120510644editdlrm
CategoryController.php87950644editdlrm
CityController.php55180644editdlrm
CmsController.php60260644editdlrm
ConfigurationController.php105640644editdlrm
CountryController.php52340644editdlrm
CouponController.php152450644editdlrm
CuisineController.php82070644editdlrm
DashboardController.php58050644editdlrm
DeliveryAreaController.php75060644editdlrm
DeliveryboyController.php76620644editdlrm
DeliveryChargeSettingsController.php45560644editdlrm
DriverOrderController.php35850644editdlrm
EnquiryController.php25410644editdlrm
FaqController.php65710644editdlrm
IngredientController.php69540644editdlrm
ItemController.php341500644editdlrm
ItemImportController.php38480644editdlrm
ItemIngredientGroupController.php111050644editdlrm
ItemMappingController.php121600644editdlrm
ItemTypeController.php74450644editdlrm
LanguageController.php38470644editdlrm
LoginController.php16840644editdlrm
LoyalityPointController.php66550644editdlrm
MallProductController.php63980644editdlrm
MetaTagController.php50390644editdlrm
MobileTranslationController.php44510644editdlrm
NewsLetterController.php52070664editdlrm
NewsletterController.php52070644editdlrm
NewsletterSubscriberController.php17470644editdlrm
NotificationController.php83820644editdlrm
OrderController.php937130644editdlrm
OrderMallProductController.php76610644editdlrm
OrderParcelController.php27520644editdlrm
OrderReportController.php39040644editdlrm
ParcelItemTypeController.php43570644editdlrm
PromotionController.php67100644editdlrm
PushNotificationController.php29900644editdlrm
RatingController.php6230644editdlrm
RefundRequestController.php29640644editdlrm
reject-index.php429310644editdlrm
RejectedOrderReportController.php5660644editdlrm
ReportController.php422320644editdlrm
RoleController.php52300644editdlrm
SiteController.php3570644editdlrm
StockController.php20670644editdlrm
TaxController.php45680644editdlrm
TodaySpecialController.php74730644editdlrm
TopOrderItemReportController.php38660644editdlrm
TopupController.php46190644editdlrm
UnitController.php71150644editdlrm
UserController.php135660644editdlrm
UserLevelController.php37870644editdlrm
VendorBankController.php28800644editdlrm
VendorController.php244910644editdlrm
VendorOrderReportController.php51460644editdlrm
VendorPaymentController.php60940644editdlrm
VendorTypeController.php84280644editdlrm
WalletController.php17910644editdlrm
WalletTranscationController.php22820644editdlrm
WebpushNotificationController.php25630644editdlrm
Edit: /var/www/vhosts/nabawater/backend/controllers/VendorOrderReportController.php (5146B)
request->queryParams); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $searchModel->search(Yii::$app->request->queryParams), 'total_order' => $total_order, 'total_earnings' => $total_earnings ]); } /** * @return string * @throws \Throwable * * @Title("List") */ public function actionVendorCodOrder() { $searchModel = new VendorOrderReportSearch(); Com::setSession('data', Yii::$app->request->queryParams); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $searchModel->search(Yii::$app->request->queryParams, 1), ]); } /** * @return string * @throws \Throwable * * @Title("List") */ public function actionVendorOnlineOrder() { $searchModel = new VendorOrderReportSearch(); $total_order = Order::TotalOrder(); $total_earnings = Order::TotalEarnings(); Com::setSession('data', Yii::$app->request->queryParams); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $searchModel->search(Yii::$app->request->queryParams, 2), ]); } /** * @throws \Throwable * @throws \yii\base\ExitException * * @Title("Export New") */ public function actionExport() { $searchModel = new VendorOrderReportSearch(); $dataProvider = $searchModel->search($_SESSION['data']); $model = $dataProvider->query->all(); $thead = []; $tbody = []; $theading = [ 'Vendor Name', 'Order Date Time', 'Order Amount', 'Discount', 'Vendor Profit', 'Admin Commission', ]; $spreadsheet = new Spreadsheet(); $sheet = $spreadsheet->getActiveSheet(); $writer = new \PhpOffice\PhpSpreadsheet\Writer\Xlsx($spreadsheet); $index = 1; foreach ($theading as $key => $value) { $sheet->setCellValueByColumnAndRow($index, 1,$theading[$key]); $index++; } $fileName = 'Vendor-Order-Report'.'-'.date('Y-m-d').'.xlsx'; $positionValue = 2; foreach ($model as $key => $value) { $sheet->setCellValue("A$positionValue", $value['vendor_name']) ->setCellValue("B$positionValue", $value['order_date_time']) ->setCellValue("C$positionValue", round($value['order_total'], 2)) ->setCellValue("D$positionValue", round($value['total_discount_value'], 2)) ->setCellValue("E$positionValue", round($value['vendor_profit'], 2)) ->setCellValue("F$positionValue", round($value['admin_commission'], 2)); ++$positionValue; } // We'll be outputting an excel file header('Content-type: text/x-csv'); // It will be called file.xls header("Content-Disposition: attachment; filename=.$fileName"); $writer->save('php://output'); exit; } public function actionQuickView() { $params = ['id']; $post = Yii::$app->getRequest()->post(); $result = ['status' => STATUS_FAIL, 'msg' => '']; foreach ($params as $param) { if ( !array_key_exists($param, $post) ) { $result['msg'] = Yii::t('backend', 'Required param missing'); goto skip; } } $resposeArray = \backend\models\Order::find() ->where(['branch_id' => $post['id']]) ->andwhere(['order_status' => Order::ORDER_STATUS_DELIVERED]) ->andwhere(['DATE(order_date_time)' => $post['date']]) ->all(); $result['status'] = STATUS_SUCCESS; $result['response'] = $resposeArray; $result['data'] = $this->renderPartial('view', ['resposeArray' => $resposeArray]); skip: return $this->asJson($result); } }