Your Name 9 months ago
parent 46bcb45d91
commit b030ca836d
  1. 2
      .user.ini
  2. 210
      application/wap/controller/Invoice.php
  3. 2
      application/wap/model/special/Special.php
  4. 25
      application/wap/model/wap/Invoice.php
  5. 25
      application/wap/model/wap/InvoiceRecords.php
  6. BIN
      public/static/frontend/1.png
  7. BIN
      public/static/frontend/2.png
  8. BIN
      public/static/frontend/3.png
  9. BIN
      public/static/frontend/advert.png
  10. BIN
      public/static/frontend/course.png
  11. BIN
      public/static/frontend/exam-bg.png
  12. BIN
      public/static/frontend/gift.png
  13. BIN
      public/static/frontend/learning-advert.png
  14. BIN
      public/static/frontend/logo.jpg
  15. BIN
      public/static/frontend/mine-bg.png
  16. BIN
      public/static/frontend/more.png
  17. BIN
      public/static/frontend/question-0.png
  18. BIN
      public/static/frontend/question-1.png
  19. BIN
      public/static/frontend/record.png
  20. BIN
      public/static/frontend/vip.png
  21. BIN
      public/static/frontend/wechat.png

@ -1 +1 @@
open_basedir=/www/wwwroot/www.ideaketang.com/:/tmp/
open_basedir=/server/wwwroot/zhishifufei_php/:/tmp/

@ -0,0 +1,210 @@
<?php
// +----------------------------------------------------------------------
// | 天诚科技 [ 刘海东 17600099397赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2020 https://www.tczxkj.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed 该系统并不是自由软件,未经许可不能去掉相关版权
// +----------------------------------------------------------------------
// | Author:甘肃天诚志信电子商务有限公司 刘海东 联系电话维系17600099397
// +----------------------------------------------------------------------
namespace app\wap\controller;
use app\wap\model\wap\InvoiceRecords;
use service\JsonService;
use think\Validate;
use think\Request;
/**会员控制器
* Class Member
* @package app\wap\controller
*/
class Invoice extends AuthController
{
protected $invoiceModel;
protected $invoiceRecordsModel;
public function _initialize()
{
parent::_initialize();
$this->invoiceModel = new \app\wap\model\wap\Invoice();
$this->invoiceRecordsModel = new InvoiceRecords();
}
/**
* 白名单
* */
public static function WhiteList()
{
return [
];
}
/**
* 开票记录
* @param Request $request
* @return null
*/
public function records(Request $request)
{
$page = $request->get('page', 1); // 当前页码
$limit = $request->get('limit', 20); // 每页显示的记录数
$invoiceList = $this->invoiceRecordsModel->order('id', 'desc')->paginate($limit, false, ['page' => $page]);
$totalCount = $invoiceList->total();
$data = [
'page' => $page,
'total' => $totalCount,
'list' => $invoiceList->items(),
];
return JsonService::successful($data);
}
/**
* 开发票
* @param Request $request
* @return null
*/
public function make(Request $request)
{
$postData = $request->post();
$rule = [
'order_number' => 'require',
'invoice_amount' => 'require|float',
'header_type' => 'require|in:1,2',
'invoice_header' => 'require',
'tax_number' => 'require',
'address' => 'require',
'bank' => 'require'
];
$validate = new Validate($rule);
$validate->rule([
'tax_number' => 'requireIf:header_type,2',
'address' => 'requireIf:header_type,2',
'bank' => 'requireIf:header_type,2'
]);
if (!$validate->check($postData)) {
JsonService::fail($validate->getError());
}
$postData['uid'] = $this->uid;
$invoice = $this->invoiceRecordsModel->create($postData);
return JsonService::successful($invoice);
}
/**
* 抬头列表
* @param Request $request
* @return null
*/
public function list(Request $request)
{
$page = $request->get('page', 1); // 当前页码
$limit = $request->get('limit', 20); // 每页显示的记录数
$invoiceList = $this->invoiceModel->order('id', 'desc')->paginate($limit, false, ['page' => $page]);
$totalCount = $invoiceList->total();
$data = [
'page' => $page,
'total' => $totalCount,
'list' => $invoiceList->items(),
];
return JsonService::successful($data);
}
/**
* 添加抬头
* @param Request $request
* @return null
*/
public function add(Request $request)
{
$postData = $request->post();
if (isset($postData['id'])) {
unset($postData['id']);
}
$this->_validate($postData);
$postData['uid'] = $this->uid;
$invoice = $this->invoiceModel->create($postData);
return JsonService::successful($invoice);
}
/**
* 修改抬头
* @param Request $request
* @return null
*/
public function edit(Request $request)
{
$postData = $request->post();
$this->_validate($postData, true);
$invoice = $this->invoiceModel->find($postData['id']);
if (!$invoice) {
return JsonService::fail('没有发票信息');
}
$postData['uid'] = $this->uid;
$invoice->save($postData);
return JsonService::successful($invoice);
}
/**
* 删除抬头
* @param Request $request
* @return null
*/
public function delete(Request $request)
{
$postData = $request->post();
$invoice = $this->invoiceModel->find($postData['id']);
if (!$invoice) {
return JsonService::fail('没有发票信息');
}
$invoice->delete();
return JsonService::successful();
}
private function _validate($postData, $edit = false)
{
$rule = [
'header_type' => 'require|in:1,2',
'invoice_header' => 'require',
'tax_number' => 'require',
'address' => 'require',
'bank' => 'require'
];
if ($edit) {
$rule['id'] = 'require';
}
$validate = new Validate($rule);
$validate->rule([
'tax_number' => 'requireIf:header_type,2',
'address' => 'requireIf:header_type,2',
'bank' => 'requireIf:header_type,2'
]);
if (!$validate->check($postData)) {
JsonService::fail($validate->getError());
}
}
}

@ -370,7 +370,7 @@ class Special extends ModelBasic
if ($where['search']) {
$model = $model->where('title|abstract', 'LIKE', "%$where[search]%");
}
if (!$where['is_member']) $model = $model->where(['is_mer_visible' => 0]);
if (isset($where['is_member']) && !$where['is_member']) $model = $model->where(['is_mer_visible' => 0]);
return $model->order('sort desc,id desc');
}
}

@ -0,0 +1,25 @@
<?php
// +----------------------------------------------------------------------
// | 天诚科技 [ 刘海东 17600099397赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2020 https://www.tczxkj.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed 该系统并不是自由软件,未经许可不能去掉相关版权
// +----------------------------------------------------------------------
// | Author:甘肃天诚志信电子商务有限公司 刘海东 联系电话维系17600099397
// +----------------------------------------------------------------------
namespace app\wap\model\wap;
use think\Db;
use traits\ModelTrait;
use basic\ModelBasic;
/**开票信息
* @package app\wap\model
*/
class Invoice extends ModelBasic
{
use ModelTrait;
}

@ -0,0 +1,25 @@
<?php
// +----------------------------------------------------------------------
// | 天诚科技 [ 刘海东 17600099397赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2020 https://www.tczxkj.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed 该系统并不是自由软件,未经许可不能去掉相关版权
// +----------------------------------------------------------------------
// | Author:甘肃天诚志信电子商务有限公司 刘海东 联系电话维系17600099397
// +----------------------------------------------------------------------
namespace app\wap\model\wap;
use think\Db;
use traits\ModelTrait;
use basic\ModelBasic;
/**开票信息
* @package app\wap\model
*/
class InvoiceRecords extends ModelBasic
{
use ModelTrait;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Loading…
Cancel
Save