123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- <?php
- namespace JinDouYun\Controller\Charts;
- use App\Tools\ErrorCode;
- use JinDouYun\Controller\BaseController;
- use JinDouYun\Model\Charts\MCharts;
- /**
- * @copyright Copyright (c) https://www.qianniaovip.com All rights reserved
- * Description: 报表
- * Class Charts
- * @package JinDouYun\Controller\Charts
- */
- class Charts extends BaseController
- {
- private $objMCharts;
- public function __construct($isCheckAcl = true, $isMustLogin = true, $checkToken = true, $getAreaCode = false, $checkShopToken = true, $checkSupplierToken = true)
- {
- parent::__construct($isCheckAcl, $isMustLogin, $checkToken, $getAreaCode, $checkShopToken, $checkSupplierToken);
- $this->objMCharts = new MCharts($this->onlineUserId,$this->onlineEnterpriseId);
- }
- /**
- * Doc: (des="商品销售报表")
- * User: XMing
- * Date: 2021/3/29
- * Time: 10:49 上午
- * @throws \Exception
- */
- public function goods()
- {
- $params = $this->request->getRawJson();
- if (empty($params)){
- parent::sendOutput("参数为空",ErrorCode::$paramError);
- }
- $pageParams = pageToOffset($params['page']?:1, $params['pageSize']?:10);
- $params['limit'] = $pageParams['limit'];
- $params['offset'] = $pageParams['offset'];
- $result = $this->objMCharts->goods($params);
- if(!$result->isSuccess()){
- parent::sendOutput($result->getData(), $result->getErrorCode());
- }
- $returnData = $result->getData();
- $pageData = [
- 'pageIndex' => $params['page'],
- 'pageSize' => $params['pageSize'],
- 'pageTotal' => $returnData['total'],
- ];
- parent::sendOutput($returnData['data'], 0, $pageData);
- }
- /**
- * Doc: (des="客户商品报表")
- * User: XMing
- * Date: 2021/3/29
- * Time: 2:22 下午
- * @throws \Exception
- */
- public function customerGoods()
- {
- $params = $this->request->getRawJson();
- if (empty($params)){
- parent::sendOutput("参数为空",ErrorCode::$paramError);
- }
- $pageParams = pageToOffset($params['page']?:1, $params['pageSize']?:10);
- $params['limit'] = $pageParams['limit'];
- $params['offset'] = $pageParams['offset'];
- $result = $this->objMCharts->customerGoods($params);
- if(!$result->isSuccess()){
- parent::sendOutput($result->getData(), $result->getErrorCode());
- }
- $returnData = $result->getData();
- $pageData = [
- 'pageIndex' => $params['page'],
- 'pageSize' => $params['pageSize'],
- 'pageTotal' => $returnData['total'],
- ];
- parent::sendOutput($returnData['data'], 0, $pageData);
- }
- /**
- * Doc: (des="订单数据表表")
- * User: XMing
- * Date: 2021/3/29
- * Time: 3:11 下午
- */
- public function order()
- {
- $params = $this->request->getRawJson();
- if (empty($params)){
- parent::sendOutput("参数为空",ErrorCode::$paramError);
- }
- $pageParams = pageToOffset($params['page']?:1, $params['pageSize']?:10);
- $params['limit'] = $pageParams['limit'];
- $params['offset'] = $pageParams['offset'];
- $result = $this->objMCharts->order($params);
- if(!$result->isSuccess()){
- parent::sendOutput($result->getData(), $result->getErrorCode());
- }
- $returnData = $result->getData();
- $pageData = [
- 'pageIndex' => $params['page'],
- 'pageSize' => $params['pageSize'],
- 'pageTotal' => $returnData['total'],
- ];
- parent::sendOutput($returnData['data'], 0, $pageData);
- }
- /**
- * Doc: (des="客户订单报表")
- * User: XMing
- * Date: 2021/3/29
- * Time: 4:01 下午
- * @throws \Exception
- */
- public function customerOrder()
- {
- $params = $this->request->getRawJson();
- if (empty($params)){
- parent::sendOutput("参数为空",ErrorCode::$paramError);
- }
- $pageParams = pageToOffset($params['page']?:1, $params['pageSize']?:10);
- $params['limit'] = $pageParams['limit'];
- $params['offset'] = $pageParams['offset'];
- $result = $this->objMCharts->customerOrder($params);
- if(!$result->isSuccess()){
- parent::sendOutput($result->getData(), $result->getErrorCode());
- }
- $returnData = $result->getData();
- $pageData = [
- 'pageIndex' => $params['page'],
- 'pageSize' => $params['pageSize'],
- 'pageTotal' => $returnData['total'],
- ];
- parent::sendOutput($returnData['data'], 0, $pageData);
- }
- /**
- * Doc: (des="业务员订单报表")
- * User: XMing
- * Date: 2021/3/29
- * Time: 4:01 下午
- * @throws \Exception
- */
- public function salesManOrder()
- {
- $params = $this->request->getRawJson();
- if (empty($params)){
- parent::sendOutput("参数为空",ErrorCode::$paramError);
- }
- $pageParams = pageToOffset($params['page']?:1, $params['pageSize']?:10);
- $params['limit'] = $pageParams['limit'];
- $params['offset'] = $pageParams['offset'];
- $result = $this->objMCharts->salesManOrder($params);
- if(!$result->isSuccess()){
- parent::sendOutput($result->getData(), $result->getErrorCode());
- }
- $returnData = $result->getData();
- $pageData = [
- 'pageIndex' => $params['page'],
- 'pageSize' => $params['pageSize'],
- 'pageTotal' => $returnData['total'],
- ];
- parent::sendOutput($returnData['data'], 0, $pageData);
- }
- /**
- * Doc: (des="地区订单报表")
- * User: XMing
- * Date: 2021/3/30
- * Time: 10:08 上午
- * @throws \Exception
- */
- public function areaOrder()
- {
- $params = $this->request->getRawJson();
- if (empty($params)){
- parent::sendOutput("参数为空",ErrorCode::$paramError);
- }
- $pageParams = pageToOffset($params['page']?:1, $params['pageSize']?:10);
- $params['limit'] = $pageParams['limit'];
- $params['offset'] = $pageParams['offset'];
- $result = $this->objMCharts->areaOrder($params);
- if(!$result->isSuccess()){
- parent::sendOutput($result->getData(), $result->getErrorCode());
- }
- $returnData = $result->getData();
- $pageData = [
- 'pageIndex' => $params['page'],
- 'pageSize' => $params['pageSize'],
- 'pageTotal' => $returnData['total'],
- ];
- parent::sendOutput($returnData['data'], 0, $pageData);
- }
- }
|