You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong/app/store/controller/user/Invoice.php

35 lines
865 B

<?php
declare (strict_types=1);
namespace app\store\controller\user;
use app\store\controller\Controller;
use app\store\model\user\UserInvoice;
use think\db\exception\DbException;
use think\response\Json;
class Invoice extends Controller
{
/**
* @notes:发票列表
* @return Json
* @throws DbException
* @author: wanghousheng
*/
public function index(): Json
{
$where = [];
$type = intval($this->request->post('type', 0));
if ($type) {
$where['type'] = $type;
}
$source = intval($this->request->post('source', 0));
if ($source) {
$where['source'] = $source;
}
$list = (new UserInvoice)->getList($where);
$data['list'] = $list->items();
$data['total'] = $list->total();
return $this->renderSuccess($data);
}
}