1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?php
- // +----------------------------------------------------------------------
- // | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
- // +----------------------------------------------------------------------
- // | Copyright (c) 2017~2021 https://www.yiovo.com All rights reserved.
- // +----------------------------------------------------------------------
- // | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
- // +----------------------------------------------------------------------
- // | Author: 萤火科技 <admin@yiovo.com>
- // +----------------------------------------------------------------------
- declare (strict_types = 1);
- namespace app\store\controller;
- use \app\store\model\Receipt as ReceiptModel;
- use app\common\service\Export as ExportService;
- /**
- * 发票模块控制器
- * Class Setting
- * @package app\store\controller
- */
- class Receipt extends Controller
- {
- /**
- * 门店管理首页
- * @return array
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
- */
- public function list()
- {
- $model = new ReceiptModel();
- $cs = request()->get();
- $list = $model->getList($cs);
- return $this->renderSuccess(compact('list'));
- }
- /**
- * 商城公共设置(仅展示可公开的信息)
- * @return array|\think\response\Json
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
- */
- public function confirmReceipt($id,$receipt_no)
- {
- $service = new ReceiptModel();
- $res = $service::updateStatus($id,$receipt_no);
- return $this->renderSuccess(compact('res'));
- }
- public function detail($id)
- {
- $list = ReceiptModel::getDetail($id);
- return $this->renderSuccess(compact('list'));
- }
- /**
- * 导出订单功能
- */
- public function export(){
- $param = $this->request->param();
- if(isset($param['receipt_ids']) && empty($param['receipt_ids'])){
- return $this->renderError('请勾选发票数据后再导出');
- }
- $model = new ReceiptModel;
- $data = $model->export($param);
- $res = ExportService::export($data['data'],$data['header'],$data['filename'],'列表','Xls');
- return $this->renderSuccess($res,'导出成功');
- }
- }
|