Compare commits
49 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6de6f5960c | |||
| 81a6d17ce0 | |||
| e15b205d00 | |||
| dc32f39c57 | |||
| 0c4c8f7a00 | |||
| cad079a9a7 | |||
| ef6e901edf | |||
| ea2635a0e4 | |||
| c1af490eff | |||
| a94e39c07d | |||
| e5b53e0fb1 | |||
| 0be23ad9e7 | |||
| 8279083391 | |||
| 67834f3e29 | |||
| 53dd1a984f | |||
| 20d44d864d | |||
| 86a0ad3724 | |||
| d37fd0194f | |||
| 0caeaa7951 | |||
| 9dc2f82452 | |||
| 102b7e1846 | |||
| a8852873d2 | |||
| c214cfed0d | |||
| ebbababc6f | |||
| 1daf123baa | |||
| f1c9abf187 | |||
| 8343432462 | |||
| a35eba495b | |||
| 926682133d | |||
| 6af2c3a78b | |||
| d3bfd98817 | |||
| d43f4b4974 | |||
| 88511c7ab2 | |||
| 9c3050240c | |||
| 1dd3503ee8 | |||
| 4d97481515 | |||
| 59cf8a26c4 | |||
| d8cd8ae9a6 | |||
| 7cfd45bf99 | |||
| c909b9b1ed | |||
| d0ae80aeff | |||
| f6c4ba3ae5 | |||
| 8db6bc92c6 | |||
| 3a8093bb57 | |||
| 648147cd4d | |||
| abfcfab3ba | |||
| 996ed300f5 | |||
| 8c81c76aa0 | |||
| 1f178435a6 |
17
.gitignore
vendored
17
.gitignore
vendored
@@ -1,6 +1,11 @@
|
|||||||
/tests/
|
/tests/
|
||||||
/.idea/
|
/.idea/
|
||||||
.editorconfig
|
.editorconfig
|
||||||
.env
|
.env
|
||||||
/vendor
|
/vendor
|
||||||
/storage/
|
/storage/app
|
||||||
|
/storage/logs
|
||||||
|
/storage/framework
|
||||||
|
/storage/debugbar/
|
||||||
|
/bootstrap/cache
|
||||||
|
/upload
|
||||||
|
|||||||
9
README.md
Normal file
9
README.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# 核销接口
|
||||||
|
|
||||||
|
[TOC]
|
||||||
|
|
||||||
|
## 文档说明
|
||||||
|
|
||||||
|
| 版本号 | 发行说明 |
|
||||||
|
| ------ | ------------------ |
|
||||||
|
| 1.0.1 | 第一版本发布 |
|
||||||
@@ -16,7 +16,7 @@ class LogController extends AdminController
|
|||||||
function grid()
|
function grid()
|
||||||
{
|
{
|
||||||
$grid = new Grid(new AccountLog);
|
$grid = new Grid(new AccountLog);
|
||||||
$grid->model()->latest();
|
$grid->model()->with(['account'])->latest();
|
||||||
$userId = request()->user_id;
|
$userId = request()->user_id;
|
||||||
$grid->model()->when($userId, function ($query, $userId) {
|
$grid->model()->when($userId, function ($query, $userId) {
|
||||||
$query->where('user_id', $userId);
|
$query->where('user_id', $userId);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class CouponController extends AdminController
|
|||||||
protected function grid()
|
protected function grid()
|
||||||
{
|
{
|
||||||
$grid = new Grid(new ActivityCoupon);
|
$grid = new Grid(new ActivityCoupon);
|
||||||
$grid->model()->latest();
|
$grid->model()->with(['outlet'])->latest();
|
||||||
$grid->disableActions();
|
$grid->disableActions();
|
||||||
$grid->disableCreateButton();
|
$grid->disableCreateButton();
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class IndexController extends AdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Index interface.
|
* Index interface.
|
||||||
* @param Content $content
|
* @param Content $content
|
||||||
* @return Content
|
* @return Content
|
||||||
*/
|
*/
|
||||||
public function index(Content $content)
|
public function index(Content $content)
|
||||||
@@ -45,8 +45,8 @@ class IndexController extends AdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Edit interface.
|
* Edit interface.
|
||||||
* @param mixed $id
|
* @param mixed $id
|
||||||
* @param Content $content
|
* @param Content $content
|
||||||
* @return Content
|
* @return Content
|
||||||
*/
|
*/
|
||||||
public function edit($id, Content $content)
|
public function edit($id, Content $content)
|
||||||
@@ -59,7 +59,7 @@ class IndexController extends AdminController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create interface.
|
* Create interface.
|
||||||
* @param Content $content
|
* @param Content $content
|
||||||
* @return Content
|
* @return Content
|
||||||
*/
|
*/
|
||||||
public function create(Content $content)
|
public function create(Content $content)
|
||||||
@@ -93,6 +93,8 @@ class IndexController extends AdminController
|
|||||||
$filter->column(1 / 2, function ($filter) {
|
$filter->column(1 / 2, function ($filter) {
|
||||||
$filter->between('start_at', '开始时间')->datetime();
|
$filter->between('start_at', '开始时间')->datetime();
|
||||||
$filter->between('end_at', '结束时间')->datetime();
|
$filter->between('end_at', '结束时间')->datetime();
|
||||||
|
$filter->equal('channel', '核销途径')->select(Activity::CHANNELS);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -101,12 +103,19 @@ class IndexController extends AdminController
|
|||||||
$grid->column('title', '活动名称');
|
$grid->column('title', '活动名称');
|
||||||
$grid->column('code', '活动编号');
|
$grid->column('code', '活动编号');
|
||||||
$grid->column('total', '可发券总数');
|
$grid->column('total', '可发券总数');
|
||||||
$grid->column('coupons_count', '可发券总数');
|
$grid->column('coupons_count', '已发券总数');
|
||||||
$grid->column('rule.code', '卡券规则');
|
$grid->column('rule.code', '卡券规则');
|
||||||
$grid->column('类型')->display(function () {
|
$grid->column('类型')->display(function () {
|
||||||
return $this->type_text;
|
return $this->type_text;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$grid->column('channel', '核销途径')
|
||||||
|
->using(Activity::CHANNELS)
|
||||||
|
->label([
|
||||||
|
Activity::CHANNEL_YSD => 'info',
|
||||||
|
Activity::CHANNEL_UNION => 'success',
|
||||||
|
]);
|
||||||
|
|
||||||
$grid->column('days', '延期(天)');
|
$grid->column('days', '延期(天)');
|
||||||
$grid->column('rule.full', '满足金额');
|
$grid->column('rule.full', '满足金额');
|
||||||
$grid->column('rule.take', '扣除金额');
|
$grid->column('rule.take', '扣除金额');
|
||||||
@@ -159,7 +168,7 @@ class IndexController extends AdminController
|
|||||||
->required();
|
->required();
|
||||||
|
|
||||||
$form->number('total', '总数')
|
$form->number('total', '总数')
|
||||||
->help('可发券总数')
|
->help('可发券总数,0为不限制')
|
||||||
->default(10000)
|
->default(10000)
|
||||||
->required();
|
->required();
|
||||||
|
|
||||||
@@ -173,6 +182,12 @@ class IndexController extends AdminController
|
|||||||
})
|
})
|
||||||
->required();
|
->required();
|
||||||
|
|
||||||
|
$form->radio('channel', '核销途径')
|
||||||
|
->options(Activity::CHANNELS)
|
||||||
|
->default(Activity::CHANNEL_YSD)
|
||||||
|
->help('券码核销的途径:亿时代是自己核销,银联是银联pos核销')
|
||||||
|
->required();
|
||||||
|
|
||||||
$form->switch('status', '状态')->default(1);
|
$form->switch('status', '状态')->default(1);
|
||||||
$form->switch('need_check', '多次校验')
|
$form->switch('need_check', '多次校验')
|
||||||
->default(1)
|
->default(1)
|
||||||
|
|||||||
@@ -69,20 +69,20 @@ class LogController extends AdminController
|
|||||||
$grid->column('id', '#ID#');
|
$grid->column('id', '#ID#');
|
||||||
$grid->column('code', '卡券编号');
|
$grid->column('code', '卡券编号');
|
||||||
$grid->column('type', '分类')
|
$grid->column('type', '分类')
|
||||||
->using(ActivityCouponLog::TYPES)
|
->using(ActivityCouponLog::TYPES)
|
||||||
->label([
|
->label([
|
||||||
1 => 'default',
|
1 => 'default',
|
||||||
2 => 'warning',
|
2 => 'warning',
|
||||||
3 => 'info',
|
3 => 'info',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$grid->column('status', '状态')
|
$grid->column('status', '状态')
|
||||||
->using(ActivityCouponLog::STATUS)
|
->using(ActivityCouponLog::STATUS)
|
||||||
->label([
|
->label([
|
||||||
1 => 'default',
|
1 => 'default',
|
||||||
2 => 'warning',
|
2 => 'warning',
|
||||||
3 => 'info',
|
3 => 'info',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$grid->column('remark', '处理结果');
|
$grid->column('remark', '处理结果');
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class IndexController extends AdminController
|
|||||||
$users = User::whereHas('identity', function ($query) {
|
$users = User::whereHas('identity', function ($query) {
|
||||||
$query->where('identity_id', 1);
|
$query->where('identity_id', 1);
|
||||||
})->get()->pluck('nickname', 'id');
|
})->get()->pluck('nickname', 'id');
|
||||||
|
|
||||||
$filter->equal('user_id', '渠道')->select($users);
|
$filter->equal('user_id', '渠道')->select($users);
|
||||||
$filter->equal('thirdPartyGoodsId', '优惠政策')->select(ActivityRule::pluck('title', 'code'));
|
$filter->equal('thirdPartyGoodsId', '优惠政策')->select(ActivityRule::pluck('title', 'code'));
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -47,9 +47,10 @@ class CensusController extends AdminController
|
|||||||
{
|
{
|
||||||
$grid = new Grid(new User);
|
$grid = new Grid(new User);
|
||||||
|
|
||||||
$grid->model()->whereHas('identity', function ($q) {
|
$grid->model()
|
||||||
$q->where('identity_id', 1);
|
->whereHas('identity', function ($q) {
|
||||||
});
|
$q->where('identity_id', 1);
|
||||||
|
});
|
||||||
|
|
||||||
$grid->disableCreateButton();
|
$grid->disableCreateButton();
|
||||||
$grid->disableBatchActions();
|
$grid->disableBatchActions();
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ use Encore\Admin\Grid;
|
|||||||
class IndexController extends AdminController
|
class IndexController extends AdminController
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $title = '渠道打款处理';
|
protected $title = '平安渠道打款处理';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notes:
|
* Notes:
|
||||||
|
|||||||
@@ -33,10 +33,12 @@ class LogController extends AdminController
|
|||||||
$grid->filter(function ($filter) {
|
$grid->filter(function ($filter) {
|
||||||
$filter->column(1 / 2, function ($filter) {
|
$filter->column(1 / 2, function ($filter) {
|
||||||
$filter->between('paid_at', '打款时间')->datetime();
|
$filter->between('paid_at', '打款时间')->datetime();
|
||||||
$users = User::whereHas('identity', function ($query) {
|
$users = User::query()
|
||||||
$query->where('identity_id', 1);
|
->whereHas('identity', function ($query) {
|
||||||
})->get()->pluck('nickname', 'id');
|
$query->where('identity_id', 1);
|
||||||
|
})
|
||||||
|
->get()
|
||||||
|
->pluck('nickname', 'id');
|
||||||
$filter->equal('user_id', '渠道')->select($users);
|
$filter->equal('user_id', '渠道')->select($users);
|
||||||
});
|
});
|
||||||
$filter->column(1 / 2, function ($filter) {
|
$filter->column(1 / 2, function ($filter) {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class HomeController extends Controller
|
|||||||
{
|
{
|
||||||
|
|
||||||
return $content
|
return $content
|
||||||
->title('数据看版1')
|
->title('数据看版2')
|
||||||
->row(function (Row $row) {
|
->row(function (Row $row) {
|
||||||
$row->column(2, function (Column $column) {
|
$row->column(2, function (Column $column) {
|
||||||
$column->append(new InfoBox(
|
$column->append(new InfoBox(
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ use RuLong\Identity\Models\Identity;
|
|||||||
|
|
||||||
class IdentityController extends AdminController
|
class IdentityController extends AdminController
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $title = '用户身份配置';
|
protected $title = '用户身份配置';
|
||||||
|
|
||||||
protected function grid()
|
protected function grid()
|
||||||
@@ -47,6 +48,7 @@ class IdentityController extends AdminController
|
|||||||
|
|
||||||
$grid->column('remark', '说明');
|
$grid->column('remark', '说明');
|
||||||
$grid->column('updated_at', '修改时间');
|
$grid->column('updated_at', '修改时间');
|
||||||
|
|
||||||
return $grid;
|
return $grid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Admin\Controllers\Log;
|
namespace App\Admin\Controllers\Log;
|
||||||
|
|
||||||
|
use App\Admin\Renderable\Log\InData;
|
||||||
|
use App\Admin\Renderable\Log\OutData;
|
||||||
use App\Models\Log;
|
use App\Models\Log;
|
||||||
use Encore\Admin\Controllers\AdminController;
|
use Encore\Admin\Controllers\AdminController;
|
||||||
use Encore\Admin\Grid;
|
use Encore\Admin\Grid;
|
||||||
@@ -15,7 +17,7 @@ class IndexController extends AdminController
|
|||||||
/**
|
/**
|
||||||
* Notes:
|
* Notes:
|
||||||
* @Author: <C.Jason>
|
* @Author: <C.Jason>
|
||||||
* @Date: 2019/9/18 14:50
|
* @Date : 2019/9/18 14:50
|
||||||
* @return Grid
|
* @return Grid
|
||||||
*/
|
*/
|
||||||
protected function grid()
|
protected function grid()
|
||||||
@@ -47,6 +49,7 @@ class IndexController extends AdminController
|
|||||||
});
|
});
|
||||||
|
|
||||||
$grid->column('id', '#ID#');
|
$grid->column('id', '#ID#');
|
||||||
|
|
||||||
// $grid->column('path', '请求地址');
|
// $grid->column('path', '请求地址');
|
||||||
$grid->column('请求地址')->display(function ($title, $column) {
|
$grid->column('请求地址')->display(function ($title, $column) {
|
||||||
return '展开';
|
return '展开';
|
||||||
@@ -56,8 +59,18 @@ class IndexController extends AdminController
|
|||||||
|
|
||||||
return new Table($header, $array);
|
return new Table($header, $array);
|
||||||
});
|
});
|
||||||
|
$grid->column('created_at', '提交时间');
|
||||||
|
|
||||||
$grid->column('method', '模式');
|
$grid->column('method', '模式');
|
||||||
// $grid->column('in_source', '请求参数');
|
// $grid->column('in_source', '请求参数')
|
||||||
|
// ->display(function ($title, $column) {
|
||||||
|
// return '点击展开';
|
||||||
|
// })->modal(InData::class);
|
||||||
|
//
|
||||||
|
// $grid->column('out_source', '返回参数')
|
||||||
|
// ->display(function ($title, $column) {
|
||||||
|
// return '点击展开';
|
||||||
|
// })->modal(OutData::class);
|
||||||
$grid->column('请求参数')->display(function () {
|
$grid->column('请求参数')->display(function () {
|
||||||
$in_source = $this->in_source;
|
$in_source = $this->in_source;
|
||||||
unset($in_source['merchantSign']);
|
unset($in_source['merchantSign']);
|
||||||
@@ -67,9 +80,9 @@ class IndexController extends AdminController
|
|||||||
unset($in_source['json']);
|
unset($in_source['json']);
|
||||||
unset($in_source['query']['merchantSign']);
|
unset($in_source['query']['merchantSign']);
|
||||||
unset($in_source['query']['merchantCert']);
|
unset($in_source['query']['merchantCert']);
|
||||||
|
|
||||||
return $in_source;
|
return $in_source;
|
||||||
});
|
});
|
||||||
// $grid->column('out_source', '返回信息');
|
|
||||||
$grid->column('返回信息')->display(function () {
|
$grid->column('返回信息')->display(function () {
|
||||||
$out_source = $this->out_source;
|
$out_source = $this->out_source;
|
||||||
|
|
||||||
@@ -83,9 +96,9 @@ class IndexController extends AdminController
|
|||||||
if (isset($out_source['data']) && is_string($out_source['data'])) {
|
if (isset($out_source['data']) && is_string($out_source['data'])) {
|
||||||
unset($out_source['data']);
|
unset($out_source['data']);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $out_source;
|
return $out_source;
|
||||||
});
|
});
|
||||||
$grid->column('created_at', '提交时间');
|
|
||||||
|
|
||||||
return $grid;
|
return $grid;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ use App\Admin\Actions\User\Callback;
|
|||||||
use App\Admin\Actions\User\Profit;
|
use App\Admin\Actions\User\Profit;
|
||||||
use App\Admin\Actions\User\ReCode;
|
use App\Admin\Actions\User\ReCode;
|
||||||
use App\Admin\Actions\User\RefD3Key;
|
use App\Admin\Actions\User\RefD3Key;
|
||||||
use App\Admin\Exporters\UsersExport;
|
use App\Admin\Renderable\User\Rule;
|
||||||
|
use App\Admin\Renderable\User\ServerKey;
|
||||||
use App\Models\Area;
|
use App\Models\Area;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Auth;
|
use Auth;
|
||||||
@@ -32,7 +33,7 @@ class IndexController extends AdminController
|
|||||||
{
|
{
|
||||||
$user = Auth::guard('admin')->user();
|
$user = Auth::guard('admin')->user();
|
||||||
$grid = new Grid(new User);
|
$grid = new Grid(new User);
|
||||||
|
$grid->model()->with(['parent']);
|
||||||
$grid->actions(function ($actions) use ($user) {
|
$grid->actions(function ($actions) use ($user) {
|
||||||
$actions->disableDelete();
|
$actions->disableDelete();
|
||||||
$actions->disableView();
|
$actions->disableView();
|
||||||
@@ -112,19 +113,7 @@ class IndexController extends AdminController
|
|||||||
|
|
||||||
$grid->column('密钥')->display(function ($title, $column) {
|
$grid->column('密钥')->display(function ($title, $column) {
|
||||||
return '点击查看';
|
return '点击查看';
|
||||||
})->modal(function ($model) {
|
})->modal(ServerKey::class);
|
||||||
$data = [
|
|
||||||
[
|
|
||||||
'服务秘钥', $model->server_key ?? '---',
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'DES3秘钥', $model->des3key ?? '---',
|
|
||||||
],
|
|
||||||
];
|
|
||||||
|
|
||||||
return new Table(['名称', '参数'], $data);
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
$grid->column('nickname', '渠道/网点');
|
$grid->column('nickname', '渠道/网点');
|
||||||
$grid->column('用户身份')->display(function () {
|
$grid->column('用户身份')->display(function () {
|
||||||
@@ -142,22 +131,13 @@ class IndexController extends AdminController
|
|||||||
|
|
||||||
$grid->column('分润规则')->display(function ($title, $column) {
|
$grid->column('分润规则')->display(function ($title, $column) {
|
||||||
return '点击展开';
|
return '点击展开';
|
||||||
})->modal(function ($model) {
|
})->modal(Rule::class);
|
||||||
if ($model->code) {
|
|
||||||
$codes = $model->code->map(function ($code) {
|
|
||||||
return $code->only(['name', 'code', 'profit']);
|
|
||||||
});
|
|
||||||
|
|
||||||
return new Table(['名称', '规则项', '分润金额(元)'], $codes->toArray());
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
$grid->column('created_at', '注册时间');
|
$grid->column('created_at', '注册时间');
|
||||||
$grid->disableExport(false);
|
$grid->disableExport(false);
|
||||||
|
|
||||||
$grid->export(function ($export) {
|
$grid->export(function ($export) {
|
||||||
$export->except(['密钥', '分润规则']);
|
$export->except(['密钥', '分润规则', '回调地址']);
|
||||||
$export->column('用户身份', function ($value, $original) {
|
$export->column('用户身份', function ($value, $original) {
|
||||||
return strip_tags($value);
|
return strip_tags($value);
|
||||||
});
|
});
|
||||||
@@ -167,7 +147,7 @@ class IndexController extends AdminController
|
|||||||
$export->column('网点编号', function ($value, $original) {
|
$export->column('网点编号', function ($value, $original) {
|
||||||
return $value . "\t";
|
return $value . "\t";
|
||||||
});
|
});
|
||||||
$export->filename('用户管理' . date("YmdHis"));
|
$export->filename($this->title . date("YmdHis"));
|
||||||
});
|
});
|
||||||
|
|
||||||
return $grid;
|
return $grid;
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ class IndexController extends AdminController
|
|||||||
protected function grid()
|
protected function grid()
|
||||||
{
|
{
|
||||||
$grid = new Grid(new WoCoupon);
|
$grid = new Grid(new WoCoupon);
|
||||||
|
$grid->model()->with(['user']);
|
||||||
$grid->disableCreateButton();
|
$grid->disableCreateButton();
|
||||||
$grid->disableBatchActions();
|
$grid->disableBatchActions();
|
||||||
// $grid->disableActions();
|
// $grid->disableActions();
|
||||||
|
|||||||
32
app/Admin/Renderable/Log/InData.php
Normal file
32
app/Admin/Renderable/Log/InData.php
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Admin\Renderable\Log;
|
||||||
|
|
||||||
|
use App\Models\Log;
|
||||||
|
use Encore\Admin\Widgets\Table;
|
||||||
|
use Illuminate\Contracts\Support\Renderable;
|
||||||
|
|
||||||
|
class InData implements Renderable
|
||||||
|
{
|
||||||
|
|
||||||
|
public function render($key = null)
|
||||||
|
{
|
||||||
|
$log = Log::find($key);
|
||||||
|
$in_source = $log->in_source;
|
||||||
|
foreach ($in_source as $key => $item) {
|
||||||
|
if (!in_array($key, [])) {
|
||||||
|
|
||||||
|
}
|
||||||
|
if (is_array($item)) {
|
||||||
|
$in_source[$key] = json_encode($item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_array($in_source) && count($in_source) > 1) {
|
||||||
|
$table = new Table(['名称', '值'], $in_source, ['panel', ' panel-default']);
|
||||||
|
|
||||||
|
return $table->render();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
25
app/Admin/Renderable/Log/OutData.php
Normal file
25
app/Admin/Renderable/Log/OutData.php
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Admin\Renderable\Log;
|
||||||
|
|
||||||
|
use App\Models\Log;
|
||||||
|
use Encore\Admin\Widgets\Table;
|
||||||
|
use Illuminate\Contracts\Support\Renderable;
|
||||||
|
|
||||||
|
class OutData implements Renderable
|
||||||
|
{
|
||||||
|
|
||||||
|
public function render($key = null)
|
||||||
|
{
|
||||||
|
$log = Log::find($key);
|
||||||
|
$out_source = $log->out_source;
|
||||||
|
|
||||||
|
if (is_array($out_source) && count($out_source) > 1) {
|
||||||
|
unset($out_source['sign']);
|
||||||
|
$table = new Table(['名称', '值'], $out_source, ['panel ', 'panel-success']);
|
||||||
|
|
||||||
|
return $table->render();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
23
app/Admin/Renderable/User/Rule.php
Normal file
23
app/Admin/Renderable/User/Rule.php
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Admin\Renderable\User;
|
||||||
|
|
||||||
|
use App\Models\User;
|
||||||
|
use Encore\Admin\Widgets\Table;
|
||||||
|
use Illuminate\Contracts\Support\Renderable;
|
||||||
|
|
||||||
|
class Rule implements Renderable
|
||||||
|
{
|
||||||
|
|
||||||
|
public function render($key = null)
|
||||||
|
{
|
||||||
|
$user = User::find($key);
|
||||||
|
$codes = $user->code->map(function ($code) {
|
||||||
|
return $code->only(['name', 'code', 'profit']);
|
||||||
|
});
|
||||||
|
$table = new Table(['名称', '规则项', '分润金额(元)'], $codes->toArray());
|
||||||
|
|
||||||
|
return $table->render();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
30
app/Admin/Renderable/User/ServerKey.php
Normal file
30
app/Admin/Renderable/User/ServerKey.php
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Admin\Renderable\User;
|
||||||
|
|
||||||
|
use App\Models\User;
|
||||||
|
use Encore\Admin\Widgets\Table;
|
||||||
|
use Illuminate\Contracts\Support\Renderable;
|
||||||
|
|
||||||
|
class ServerKey implements Renderable
|
||||||
|
{
|
||||||
|
|
||||||
|
public function render($key = null)
|
||||||
|
{
|
||||||
|
$user = User::find($key);
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
[
|
||||||
|
'服务秘钥', $user->server_key ?? '---',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'DES3秘钥', $user->des3key ?? '---',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
$table = new Table(['名称', '参数'], $data);
|
||||||
|
|
||||||
|
return $table->render();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -117,11 +117,11 @@ trait ApiResponse
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 成功的返回
|
* 成功的返回
|
||||||
* @Author :<C.Jason>
|
* @Author :<C.Jason>
|
||||||
* @Date :2018-05-22
|
* @Date :2018-05-22
|
||||||
* @param [type] $data [description]
|
* @param [type] $data [description]
|
||||||
* @param string $status [description]
|
* @param string $log
|
||||||
* @return [type] [description]
|
* @return [type] [description]
|
||||||
*/
|
*/
|
||||||
public function success($data, $log = '')
|
public function success($data, $log = '')
|
||||||
{
|
{
|
||||||
|
|||||||
16
app/Api/Controllers/IndexController.php
Normal file
16
app/Api/Controllers/IndexController.php
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Api\Controllers;
|
||||||
|
|
||||||
|
class IndexController extends Controller
|
||||||
|
{
|
||||||
|
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
return $this->respond('200', [
|
||||||
|
'code' => 200,
|
||||||
|
'message' => 'Json Api is ready',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -41,7 +41,7 @@ class UserController extends Controller
|
|||||||
{
|
{
|
||||||
$inputdata = $request->all();
|
$inputdata = $request->all();
|
||||||
$res = $this->checkSign($request);
|
$res = $this->checkSign($request);
|
||||||
|
//获取解密后数据
|
||||||
$inputdata['jiemi'] = $res;
|
$inputdata['jiemi'] = $res;
|
||||||
$log = $this->createLog($request->url(), 'POST', $inputdata, 'grant'); //添加日志
|
$log = $this->createLog($request->url(), 'POST', $inputdata, 'grant'); //添加日志
|
||||||
|
|
||||||
@@ -184,11 +184,20 @@ class UserController extends Controller
|
|||||||
$total = $res['total'] ?? ''; //订单总额;
|
$total = $res['total'] ?? ''; //订单总额;
|
||||||
$outletId = $res['outletId'] ?? ''; //网点id;
|
$outletId = $res['outletId'] ?? ''; //网点id;
|
||||||
$orderid = $res['orderid'] ?? ''; //订单id;
|
$orderid = $res['orderid'] ?? ''; //订单id;
|
||||||
|
$from = $res['from'] ?? ''; //来源;
|
||||||
|
|
||||||
$redemptionCode = trim($redemptionCode);
|
$redemptionCode = trim($redemptionCode);
|
||||||
$outletId = trim($outletId);
|
$outletId = trim($outletId);
|
||||||
|
|
||||||
$coupon = Coupon::Redemption($this->user, $redemptionCode, $total, $outletId, $orderid);
|
$coupon = Coupon::Redemption(
|
||||||
|
$this->user,
|
||||||
|
$redemptionCode,
|
||||||
|
$total,
|
||||||
|
$outletId,
|
||||||
|
$orderid,
|
||||||
|
$from
|
||||||
|
);
|
||||||
|
|
||||||
if (is_string($coupon)) {
|
if (is_string($coupon)) {
|
||||||
return $this->error($coupon, $log);
|
return $this->error($coupon, $log);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
Route::group(['prefix' => 'V1'], function () {
|
Route::group(['prefix' => 'V1'], function () {
|
||||||
|
Route::get('/', 'IndexController@index');
|
||||||
|
|
||||||
Route::post('user/get', 'UserController@index');
|
Route::post('user/get', 'UserController@index');
|
||||||
Route::post('user/check', 'UserController@check');
|
Route::post('user/check', 'UserController@check');
|
||||||
|
|
||||||
|
|||||||
@@ -7,18 +7,16 @@ use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
|||||||
|
|
||||||
class Handler extends ExceptionHandler
|
class Handler extends ExceptionHandler
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of the exception types that are not reported.
|
* A list of the exception types that are not reported.
|
||||||
*
|
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $dontReport = [
|
protected $dontReport = [
|
||||||
//
|
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of the inputs that are never flashed for validation exceptions.
|
* A list of the inputs that are never flashed for validation exceptions.
|
||||||
*
|
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $dontFlash = [
|
protected $dontFlash = [
|
||||||
@@ -28,8 +26,7 @@ class Handler extends ExceptionHandler
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Report or log an exception.
|
* Report or log an exception.
|
||||||
*
|
* @param \Exception $exception
|
||||||
* @param \Exception $exception
|
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function report(Exception $exception)
|
public function report(Exception $exception)
|
||||||
@@ -39,13 +36,13 @@ class Handler extends ExceptionHandler
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Render an exception into an HTTP response.
|
* Render an exception into an HTTP response.
|
||||||
*
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Exception $exception
|
||||||
* @param \Exception $exception
|
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function render($request, Exception $exception)
|
public function render($request, Exception $exception)
|
||||||
{
|
{
|
||||||
return parent::render($request, $exception);
|
return parent::render($request, $exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,44 +2,72 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Api\Controllers\ApiResponse;
|
use Illuminate\Http\Request;
|
||||||
|
use League\Flysystem\Sftp\SftpAdapter;
|
||||||
|
use League\Flysystem\Filesystem;
|
||||||
|
use XuanChen\UnionPay\Check;
|
||||||
|
|
||||||
class SkyxuController
|
class SkyxuController extends Controller
|
||||||
{
|
{
|
||||||
use ApiResponse;
|
|
||||||
|
|
||||||
public function index()
|
/**
|
||||||
|
* Notes: 链接sftp
|
||||||
|
* @Author: 玄尘
|
||||||
|
* @Date : 2021/1/26 8:18
|
||||||
|
*/
|
||||||
|
public function sftp()
|
||||||
{
|
{
|
||||||
$postData = [
|
$app = app('xuanchen.unionpay.check');
|
||||||
'server_id' => '20200103490104',
|
$app->date = '20190722';
|
||||||
'key' => 'rRhHO7Jbao2SSxAH8VygV4DgS4L2WESa',
|
$app->login();
|
||||||
'addcode' => '69198663',
|
$app->hasFile();
|
||||||
'sign' => '6cd2232e9aa853219a0dff80430567796d0ae33d6c0289dfa835813def08ed8c',
|
$app->start();
|
||||||
'data' => 'DBEgnb5HidvKQDyxL0BAcCwuMkVdbTZRVu4mxwwzAM5TWj\/HAQfcrH9VzcgdG42lINsHYvI2Tv+MJfyP9eXVEQ==',
|
dump($app->msg);
|
||||||
];
|
|
||||||
|
|
||||||
$curl = curl_init();
|
die();
|
||||||
|
$path = '/home/wwwroot/pingan/upload/';
|
||||||
|
$name = 'JYMX66007320190722.txt';
|
||||||
|
$adapter = new SftpAdapter([
|
||||||
|
'host' => '123.57.16.212',
|
||||||
|
'port' => 22,
|
||||||
|
'username' => 'root',
|
||||||
|
'password' => 'Anetadmin1',
|
||||||
|
'privateKey' => '',
|
||||||
|
'passphrase' => '',
|
||||||
|
'root' => $path,
|
||||||
|
'timeout' => 10,
|
||||||
|
'directoryPerm' => 0755,
|
||||||
|
]);
|
||||||
|
|
||||||
curl_setopt_array($curl, array(
|
$filesystem = new Filesystem($adapter);
|
||||||
CURLOPT_URL => "http://pa.cnskl.com/api/V1/user/freezecoupon",
|
$lists = $filesystem->listContents();
|
||||||
CURLOPT_RETURNTRANSFER => true,
|
|
||||||
CURLOPT_ENCODING => "",
|
|
||||||
CURLOPT_MAXREDIRS => 10,
|
|
||||||
CURLOPT_TIMEOUT => 0,
|
|
||||||
CURLOPT_FOLLOWLOCATION => true,
|
|
||||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
|
||||||
CURLOPT_CUSTOMREQUEST => "POST",
|
|
||||||
CURLOPT_POSTFIELDS => $postData,
|
|
||||||
CURLOPT_HTTPHEADER => array(
|
|
||||||
"Content-Type: multipart/form-data;",
|
|
||||||
),
|
|
||||||
));
|
|
||||||
|
|
||||||
$response = curl_exec($curl);
|
$content = $filesystem->read($name);
|
||||||
|
|
||||||
curl_close($curl);
|
$content = str_replace("\n", "br", $content);
|
||||||
echo $response;
|
dump($content);
|
||||||
|
|
||||||
|
$content = explode("br", $content);
|
||||||
|
|
||||||
|
foreach ($content as $item) {
|
||||||
|
$array = explode('|', $item);
|
||||||
|
foreach ($array as $item) {
|
||||||
|
echo $item . "<br>";
|
||||||
|
}
|
||||||
|
echo '----------------------------------------' . "<br>";
|
||||||
|
}
|
||||||
|
dd($content);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
public function index(Request $request)
|
||||||
|
{
|
||||||
|
if (method_exists($this, $request->action)) {
|
||||||
|
|
||||||
|
return call_user_func_array([$this, $request->action], [$request->all()]);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
dd('未找到方法');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,251 +1,305 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Api\Controllers\ApiResponse;
|
use App\Api\Controllers\ApiResponse;
|
||||||
use SelfCoupon;
|
use App\Models\User;
|
||||||
use App\Models\User;
|
use GuzzleHttp\Client;
|
||||||
use GuzzleHttp\Client;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Request;
|
use XuanChen\Coupon\Coupon;
|
||||||
use XuanChen\Coupon\Coupon;
|
|
||||||
|
class TestController
|
||||||
// use Wo;
|
{
|
||||||
|
|
||||||
class TestController
|
use ApiResponse;
|
||||||
{
|
|
||||||
|
public $baseUrl = 'http://pac.ysd-bs.com/api/V1/';
|
||||||
use ApiResponse;
|
|
||||||
|
public function index(Request $request)
|
||||||
public $baseUrl = 'http://pa.ysd-bs.com/api/V1/';
|
{
|
||||||
|
$this->user = User::find(6);
|
||||||
public function index(Request $request)
|
$ret = [
|
||||||
{
|
'redemptionCode' => 'YSD201029312435',
|
||||||
// $user_id = $request->user_id;
|
'outletId' => '2008030929274',
|
||||||
// $data = $request->data;
|
];
|
||||||
// $this->user = User::find(3);
|
|
||||||
//
|
$ret = [
|
||||||
// $data = '5VehIrHTZsS1BY8V5VcKlhTN9hbutq4j+HIT2zRCbSqgPWvClQSxYSP7mn7PmHuiYQpj55NRC6w4397FfdVTq23wd4BOQ964giie/JForTjt0l7UaY23XzKnNjDSKiGqr7DAbd8P3SzJ75ZjKaqUu7UWu3PVylAeesGRbZgpQEF/XKwOW4XMaJGV2tIsowILZCtF+moqHg7yA6hI4vT7iYU3rTq9vk7kpcnfArLKPQ5dxH9FFIegdr7E1S8NVwpTZrxeQEmjDUsGrBcWe/Q9dRWXSlKF1Hdz2qCUCK94fu3gqvEVSYRllTCa5mwQhlYJLs2UTmWMSism7nsivySseSl1/JOvNH0lyvWaV1XDUMKG8oTC+kOPQKxFA3qp2xO9ohRhN0dkpML4JVgkMF1r6rv+rThYQuOL/rnsuY5Jdh4QdPWCItQ05lqI46s2yPyKROrLx7jQ3/+BOyEmP+Cj5W8/trEAVS1HczMj4Jnl3vrcY879ubokUcEatalAuKGM0uLNAqQF5XfHzgXam4coEMek8MjdbxW+Z9+eZFQp/P1ts7yN5qzpac6Y8CrqSMFJZf1vwowp+1peiEC5tCsXlHCsDLPS8Uh1LNnC3sag0XZu7jX5uVR9nxR2c/ibBJOAHcUO+NcjmzoN+dQOeBkb/aWj9B+9mW5RUQmfUk6O+Vwkb5ruZZbXsoJJULj4tHJv87+mVo30e0mBbaPD47+fTp1+qSJtLOOlLO2nEj1NNDBSBGLM4RxTDQ4ju2r6HY9YyMXsbNC2YB8zrXrDsUoB1WSuu5XcaWx8rzA0NpckzNbEIuv0+6fA69gXOhC9xcGGPyEBbko73XHr7W8MIDtWhGOG8kHf1cAMdjwVGS2OUJ6XKZnBMwIzY8cJn4Fi+jXRMFnt+7BxWLToNQsyOoHbYWypeM8FrAb4VQeaxGhBQUXUmHhmAp00jcGEe/ngxn1oVjq6G+pEq8CxBntvQ+GZ975sPaCqkYOjbuHa9Myd2tT6GWbczL/YcR4RRV96ByYYCEOBy01LsBNeo6SSpWYcK4eoLhc70v8s';
|
'mobile' => '15663876870',
|
||||||
// $iv = substr($this->user->des3key, 0, 8);
|
'orderid' => '202008105236478',
|
||||||
// $ret = openssl_decrypt($data, 'DES-EDE3-CBC', $this->user->des3key, 0, $iv);
|
'activityId' => 'ysd202010272',
|
||||||
// if (false === $ret) {
|
'outletId' => '2008241014458',
|
||||||
// return openssl_error_string();
|
|
||||||
// }
|
];
|
||||||
// dd($ret);
|
|
||||||
// dd();
|
return $this->success($ret);
|
||||||
$this->user = User::find(4);
|
dd();
|
||||||
$ret = [
|
$user_id = $request->user_id;
|
||||||
'variable' => 100,
|
$data = $request->data;
|
||||||
'mobile' => 15663876870,
|
$this->user = User::find(3);
|
||||||
'type' => 'silver',
|
|
||||||
'remark' => '测试',
|
$data = '5VehIrHTZsS1BY8V5VcKlhTN9hbutq4j+HIT2zRCbSqgPWvClQSxYSP7mn7PmHuiYQpj55NRC6w4397FfdVTq23wd4BOQ964giie/JForTjt0l7UaY23XzKnNjDSKiGqr7DAbd8P3SzJ75ZjKaqUu7UWu3PVylAeesGRbZgpQEF/XKwOW4XMaJGV2tIsowILZCtF+moqHg7yA6hI4vT7iYU3rTq9vk7kpcnfArLKPQ5dxH9FFIegdr7E1S8NVwpTZrxeQEmjDUsGrBcWe/Q9dRWXSlKF1Hdz2qCUCK94fu3gqvEVSYRllTCa5mwQhlYJLs2UTmWMSism7nsivySseSl1/JOvNH0lyvWaV1XDUMKG8oTC+kOPQKxFA3qp2xO9ohRhN0dkpML4JVgkMF1r6rv+rThYQuOL/rnsuY5Jdh4QdPWCItQ05lqI46s2yPyKROrLx7jQ3/+BOyEmP+Cj5W8/trEAVS1HczMj4Jnl3vrcY879ubokUcEatalAuKGM0uLNAqQF5XfHzgXam4coEMek8MjdbxW+Z9+eZFQp/P1ts7yN5qzpac6Y8CrqSMFJZf1vwowp+1peiEC5tCsXlHCsDLPS8Uh1LNnC3sag0XZu7jX5uVR9nxR2c/ibBJOAHcUO+NcjmzoN+dQOeBkb/aWj9B+9mW5RUQmfUk6O+Vwkb5ruZZbXsoJJULj4tHJv87+mVo30e0mBbaPD47+fTp1+qSJtLOOlLO2nEj1NNDBSBGLM4RxTDQ4ju2r6HY9YyMXsbNC2YB8zrXrDsUoB1WSuu5XcaWx8rzA0NpckzNbEIuv0+6fA69gXOhC9xcGGPyEBbko73XHr7W8MIDtWhGOG8kHf1cAMdjwVGS2OUJ6XKZnBMwIzY8cJn4Fi+jXRMFnt+7BxWLToNQsyOoHbYWypeM8FrAb4VQeaxGhBQUXUmHhmAp00jcGEe/ngxn1oVjq6G+pEq8CxBntvQ+GZ975sPaCqkYOjbuHa9Myd2tT6GWbczL/YcR4RRV96ByYYCEOBy01LsBNeo6SSpWYcK4eoLhc70v8s';
|
||||||
];
|
$iv = substr($this->user->des3key, 0, 8);
|
||||||
$res['server_id'] = $this->user->server_id;
|
$ret = openssl_decrypt($data, 'DES-EDE3-CBC', $this->user->des3key, 0, $iv);
|
||||||
$res['des'] = $this->user->des3key;
|
if (false === $ret) {
|
||||||
$res['key'] = $this->user->server_key;
|
return openssl_error_string();
|
||||||
|
}
|
||||||
return $this->success($ret);
|
dd($ret);
|
||||||
dd();
|
dd();
|
||||||
$this->user = User::find(4);
|
$this->user = User::find(215);
|
||||||
$ret = [
|
$ret = [
|
||||||
'redemptionCode' => '951951858070',
|
'redemptionCode' => '951951858070',
|
||||||
'total' => 5,
|
'total' => 5,
|
||||||
'outletId' => '2008241014458',
|
'outletId' => '2006151433887',
|
||||||
];
|
];
|
||||||
|
|
||||||
return $this->success($ret);
|
return $this->success($ret);
|
||||||
dd(phpinfo());
|
dd(phpinfo());
|
||||||
dd();
|
dd();
|
||||||
$num = 100;
|
$num = 100;
|
||||||
|
|
||||||
for ($i = 1; $i <= $num; $i++) {
|
for ($i = 1; $i <= $num; $i++) {
|
||||||
$data = [
|
$data = [
|
||||||
'outletId' => '2004020935777',
|
'outletId' => '2004020935777',
|
||||||
'activityId' => 'ysd20200740',
|
'activityId' => 'ysd20200740',
|
||||||
'mobile' => '15663876870',
|
'mobile' => '15663876870',
|
||||||
];
|
];
|
||||||
|
|
||||||
$this->user = User::find(3);
|
$this->user = User::find(3);
|
||||||
|
|
||||||
$data = $this->jiami($data);
|
$data = $this->jiami($data);
|
||||||
|
|
||||||
$url = $this->baseUrl . 'user/grant';
|
$url = $this->baseUrl . 'user/grant';
|
||||||
$res = $this->http($data, $url);
|
$res = $this->http($data, $url);
|
||||||
|
|
||||||
// if (isset($res['data'])) {
|
// if (isset($res['data'])) {
|
||||||
// $jiemi = $this->jiemi($res['data']);
|
// $jiemi = $this->jiemi($res['data']);
|
||||||
// dump($jiemi);
|
// dump($jiemi);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dump($this->getElapsedTime());
|
dump($this->getElapsedTime());
|
||||||
dump($this->getMemoryUsage());
|
dump($this->getMemoryUsage());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notes: 发券
|
* Notes: 发券
|
||||||
* @Author: 玄尘
|
* @Author: 玄尘
|
||||||
* @Date : 2020/6/29 13:57
|
* @Date : 2020/6/29 13:57
|
||||||
*/
|
*/
|
||||||
public function grant(Request $request)
|
public function grant(Request $request)
|
||||||
{
|
{
|
||||||
$this->user = User::find(3);
|
$this->user = User::find(299);
|
||||||
|
|
||||||
$data = $this->jiami($request->all());
|
$data = $this->jiami($request->all());
|
||||||
|
|
||||||
$url = $this->baseUrl . 'user/grant';
|
$url = $this->baseUrl . 'user/grant';
|
||||||
$res = $this->http($data, $url);
|
$res = $this->http($data, $url);
|
||||||
|
|
||||||
return $res;
|
return $res;
|
||||||
|
|
||||||
// dump($this->getElapsedTime());
|
// dump($this->getElapsedTime());
|
||||||
// dump($this->getMemoryUsage());
|
// dump($this->getMemoryUsage());
|
||||||
//
|
//
|
||||||
// dd($res);
|
// dd($res);
|
||||||
}
|
}
|
||||||
|
|
||||||
//查询
|
//查询
|
||||||
public function query(Request $request)
|
public function query(Request $request)
|
||||||
{
|
{
|
||||||
$this->user = User::find(3);
|
$this->user = User::find(3);
|
||||||
|
|
||||||
$redemptionCode = $request->redemptionCode;
|
$redemptionCode = $request->redemptionCode;
|
||||||
$outletId = $request->outletId;
|
$outletId = $request->outletId;
|
||||||
|
|
||||||
$data = $this->jiami($request->all());
|
$data = $this->jiami($request->all());
|
||||||
|
|
||||||
$url = $this->baseUrl . 'user/query';
|
$url = $this->baseUrl . 'user/query';
|
||||||
$res = $this->http($data, $url);
|
$res = $this->http($data, $url);
|
||||||
|
|
||||||
return $res;
|
return $res;
|
||||||
if (isset($res['data'])) {
|
if (isset($res['data'])) {
|
||||||
$jiemi = $this->jiemi($res['data']);
|
$jiemi = $this->jiemi($res['data']);
|
||||||
dump($jiemi);
|
dump($jiemi);
|
||||||
}
|
}
|
||||||
|
|
||||||
dump($this->getElapsedTime());
|
dump($this->getElapsedTime());
|
||||||
dump($this->getMemoryUsage());
|
dump($this->getMemoryUsage());
|
||||||
|
|
||||||
dump($res);
|
dump($res);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//卡券作废
|
//卡券作废
|
||||||
public function destroy(Request $request)
|
public function destroy(Request $request)
|
||||||
{
|
{
|
||||||
$this->user = User::find(3);
|
$this->user = User::find(3);
|
||||||
|
|
||||||
$redemptionCode = $request->redemptionCode;
|
$redemptionCode = $request->redemptionCode;
|
||||||
$data = $this->jiami($request->all());
|
$data = $this->jiami($request->all());
|
||||||
|
|
||||||
$url = $this->baseUrl . 'user/destroy';
|
$url = $this->baseUrl . 'user/destroy';
|
||||||
$res = $this->http($data, $url);
|
$res = $this->http($data, $url);
|
||||||
|
|
||||||
dump($this->getElapsedTime());
|
dump($this->getElapsedTime());
|
||||||
dump($this->getMemoryUsage());
|
dump($this->getMemoryUsage());
|
||||||
if (isset($res['data'])) {
|
if (isset($res['data'])) {
|
||||||
$jiemi = $this->jiemi($res['data']);
|
$jiemi = $this->jiemi($res['data']);
|
||||||
dump($jiemi);
|
dump($jiemi);
|
||||||
}
|
}
|
||||||
dump($res);
|
dump($res);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notes: 核销
|
* Notes: 核销
|
||||||
* @Author: 玄尘
|
* @Author: 玄尘
|
||||||
* @Date : 2020/6/29 14:01
|
* @Date : 2020/6/29 14:01
|
||||||
*/
|
*/
|
||||||
public function checkcoupon(Request $request)
|
public function checkcoupon(Request $request)
|
||||||
{
|
{
|
||||||
$user_id = $request->user_id;
|
$user_id = $request->user_id;
|
||||||
|
|
||||||
$this->user = User::find($user_id);
|
$this->user = User::find($user_id);
|
||||||
|
|
||||||
$data = $this->jiami([
|
$data = $this->jiami([
|
||||||
'redemptionCode' => $request->redemptionCode,
|
'redemptionCode' => $request->redemptionCode,
|
||||||
'total' => $request->total,
|
'total' => $request->total,
|
||||||
'outletId' => $request->outletId,
|
'outletId' => $request->outletId,
|
||||||
'orderid' => $request->orderid,
|
'orderid' => $request->orderid,
|
||||||
]);
|
'from' => $request->from,
|
||||||
|
]);
|
||||||
$url = $this->baseUrl . 'user/freezecoupon';
|
|
||||||
$res = $this->http($data, $url);
|
$url = $this->baseUrl . 'user/freezecoupon';
|
||||||
|
$res = $this->http($data, $url);
|
||||||
return $res;
|
|
||||||
|
return $res;
|
||||||
$redemptionCode = $request->redemptionCode;
|
|
||||||
$total = $request->total;
|
$redemptionCode = $request->redemptionCode;
|
||||||
$outletId = $request->outletId;
|
$total = $request->total;
|
||||||
$orderid = $request->orderid ?? '';
|
$outletId = $request->outletId;
|
||||||
$res = Coupon::Redemption($this->user, $redemptionCode, $total, $outletId, $orderid);
|
$orderid = $request->orderid ?? '';
|
||||||
|
$from = $request->from ?? '';
|
||||||
if (is_string($res)) {
|
|
||||||
return $this->error($res);
|
$res = Coupon::Redemption(
|
||||||
}
|
$this->user,
|
||||||
|
$redemptionCode,
|
||||||
return $this->success('核销成功');
|
$total,
|
||||||
}
|
$outletId,
|
||||||
|
$orderid,
|
||||||
public function http($data, $url)
|
$from
|
||||||
{
|
);
|
||||||
$client = new Client();
|
|
||||||
$response = $client->request('POST', $url, ['form_params' => $data, 'http_errors' => false]);
|
if (is_string($res)) {
|
||||||
|
return $this->error($res);
|
||||||
$body = $response->getBody();
|
}
|
||||||
$content = $body->getContents();
|
|
||||||
$result = json_decode($content, true);
|
return $this->success('核销成功');
|
||||||
|
}
|
||||||
return $result;
|
|
||||||
}
|
public function http($data, $url)
|
||||||
|
{
|
||||||
public function jiami($ret)
|
$client = new Client();
|
||||||
{
|
$response = $client->request('POST', $url, ['form_params' => $data, 'http_errors' => false]);
|
||||||
$jsonData = json_encode($ret); //数据JSON化
|
|
||||||
$ascdata = $this->keyasc($jsonData); //加密
|
$body = $response->getBody();
|
||||||
$addcode = sprintf("%08d", mt_rand(0, 99999999)); //随机code 验证签名用
|
$content = $body->getContents();
|
||||||
$sign = $this->keysign($ascdata, $addcode);
|
$result = json_decode($content, true);
|
||||||
|
|
||||||
$data = [
|
return $result;
|
||||||
'server_id' => $this->user->server_id,
|
}
|
||||||
'key' => $this->user->server_key,
|
|
||||||
'addcode' => $addcode,
|
public function jiami($ret)
|
||||||
'sign' => $sign,
|
{
|
||||||
'data' => $ascdata,
|
$jsonData = json_encode($ret); //数据JSON化
|
||||||
];
|
$ascdata = $this->keyasc($jsonData); //加密
|
||||||
|
$addcode = sprintf("%08d", mt_rand(0, 99999999)); //随机code 验证签名用
|
||||||
return $data;
|
$sign = $this->keysign($ascdata, $addcode);
|
||||||
}
|
|
||||||
|
$data = [
|
||||||
/**
|
'server_id' => $this->user->server_id,
|
||||||
* 解密
|
'key' => $this->user->server_key,
|
||||||
* @param <type> $value
|
'addcode' => $addcode,
|
||||||
* @return <type>
|
'sign' => $sign,
|
||||||
*/
|
'data' => $ascdata,
|
||||||
public function jiemi($value)
|
];
|
||||||
{
|
|
||||||
$iv = substr($this->user->des3key, 0, 8);
|
return $data;
|
||||||
$ret = openssl_decrypt($value, 'DES - EDE3 - CBC', $this->user->des3key, 0, $iv);
|
}
|
||||||
if (false === $ret) {
|
|
||||||
return openssl_error_string();
|
/**
|
||||||
}
|
* 解密
|
||||||
|
* @param <type> $value
|
||||||
return $ret;
|
* @return <type>
|
||||||
}
|
*/
|
||||||
|
public function jiemi($value)
|
||||||
function getMemoryUsage($precision = 2)
|
{
|
||||||
{
|
$iv = substr($this->user->des3key, 0, 8);
|
||||||
$size = memory_get_usage(true);
|
$ret = openssl_decrypt($value, 'DES - EDE3 - CBC', $this->user->des3key, 0, $iv);
|
||||||
|
if (false === $ret) {
|
||||||
$unit = ['b', 'kb', 'mb', 'gb', 'tb', 'pb'];
|
return openssl_error_string();
|
||||||
|
}
|
||||||
return round($size / pow(1024, ($i = floor(log($size, 1024)))), $precision) . ' ' . $unit[$i];
|
|
||||||
}
|
return $ret;
|
||||||
|
}
|
||||||
function getElapsedTime(int $decimals = 2)
|
|
||||||
{
|
public function getMemoryUsage($precision = 2)
|
||||||
return number_format(microtime(true) - request()->server('REQUEST_TIME_FLOAT'), $decimals) . ' s';
|
{
|
||||||
}
|
$size = memory_get_usage(true);
|
||||||
|
|
||||||
}
|
$unit = ['b', 'kb', 'mb', 'gb', 'tb', 'pb'];
|
||||||
|
|
||||||
|
return round($size / pow(1024, ($i = floor(log($size, 1024)))), $precision) . ' ' . $unit[$i];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getElapsedTime(int $decimals = 2)
|
||||||
|
{
|
||||||
|
return number_format(microtime(true) - request()->server('REQUEST_TIME_FLOAT'), $decimals) . ' s';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Notes: 测试签名
|
||||||
|
* @Author: 玄尘
|
||||||
|
* @Date : 2020/12/30 11:47
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
*/
|
||||||
|
public function getSign(Request $request)
|
||||||
|
{
|
||||||
|
|
||||||
|
// $data = 'SMyBpCxqBnxAGr/Fk9LOB851Glkgc3ruZnu1Y0ft/R+Ng26ooLXok1Oi1SrwhSJaQ9U75zy3tI7fq3YfTLQxITwUmt4jBiShpeK1whMaYrI=';
|
||||||
|
// $addcode = '1234567812345678';
|
||||||
|
//
|
||||||
|
// return [
|
||||||
|
// 'sign' => $this->keysign($data, $addcode),
|
||||||
|
// 'server_id' => $this->user->server_id,
|
||||||
|
// 'server_key' => $this->user->server_key,
|
||||||
|
// 'data' => $data,
|
||||||
|
// 'addcode' => $addcode,
|
||||||
|
// ];
|
||||||
|
|
||||||
|
$server_id = $request->server_id;
|
||||||
|
$redemptionCode = $request->redemptionCode;
|
||||||
|
$total = $request->total;
|
||||||
|
$outletId = $request->outletId;
|
||||||
|
|
||||||
|
$this->user = User::whereNull('parent_id')
|
||||||
|
->where('server_id', $server_id)
|
||||||
|
->first();
|
||||||
|
if (!$this->user) {
|
||||||
|
return $this->error('未查到到渠道');
|
||||||
|
}
|
||||||
|
$ret = [
|
||||||
|
'redemptionCode' => $redemptionCode,
|
||||||
|
'total' => $total,
|
||||||
|
'outletId' => $outletId,
|
||||||
|
];
|
||||||
|
|
||||||
|
return json_encode($ret);
|
||||||
|
info(json_encode($ret));
|
||||||
|
|
||||||
|
return $this->success($ret);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,68 +1,69 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Listeners;
|
namespace App\Listeners;
|
||||||
|
|
||||||
use App\Events\ConponCallback;
|
use App\Events\ConponCallback;
|
||||||
use App\Models\ActivityCouponLog;
|
use App\Models\ActivityCouponLog;
|
||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
|
|
||||||
class ConponCallbackListener implements ShouldQueue
|
class ConponCallbackListener implements ShouldQueue
|
||||||
{
|
{
|
||||||
|
|
||||||
public $queue = 'LISTENER';
|
public $queue = 'LISTENER';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle the event.
|
* Handle the event.
|
||||||
* @param RoomLoginDone $event
|
* @param RoomLoginDone $event
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function handle(ConponCallback $event)
|
public function handle(ConponCallback $event)
|
||||||
{
|
{
|
||||||
$acticity_coupon = $event->acticity_coupon;
|
$acticity_coupon = $event->acticity_coupon;
|
||||||
|
|
||||||
$user = $acticity_coupon->outlet->parent;
|
$user = $acticity_coupon->outlet->parent;
|
||||||
if ($user->callback) {
|
if ($user->callback) {
|
||||||
$client = new Client();
|
$client = new Client();
|
||||||
|
|
||||||
$response = $client->request('post', $user->callback, [
|
$response = $client->request('post', $user->callback, [
|
||||||
'timeout' => 30,
|
'timeout' => 30,
|
||||||
'query' => [
|
'query' => [
|
||||||
'code' => $acticity_coupon->code,
|
'code' => $acticity_coupon->code,
|
||||||
'status' => $acticity_coupon->status,
|
'status' => $acticity_coupon->status,
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'code' => $acticity_coupon->code,
|
'code' => $acticity_coupon->code,
|
||||||
'type' => $acticity_coupon->status == 2 ? 'Verification' : 'Destroy',
|
'type' => $acticity_coupon->status == 2 ? 'Verification' : 'Destroy',
|
||||||
'url' => $user->callback,
|
'url' => $user->callback,
|
||||||
];
|
];
|
||||||
|
|
||||||
$error = false;
|
$error = false;
|
||||||
|
|
||||||
if ($response->getStatusCode() == 200) {
|
if ($response->getStatusCode() == 200) {
|
||||||
$body = $response->getBody();
|
$body = $response->getBody();
|
||||||
$result = json_decode($body->getContents(), true);
|
$result = json_decode($body->getContents(), true);
|
||||||
|
|
||||||
$data['status'] = $result['code'] ?? '';
|
$data['status'] = $result['code'] ?? '';
|
||||||
$data['source'] = $result;
|
$data['source'] = $result;
|
||||||
$data['remark'] = $result['message'] ?? '';
|
$data['remark'] = $result['message'] ?? '';
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$data['status'] = 0;
|
$data['status'] = 0;
|
||||||
$data['source'] = '';
|
$data['source'] = '';
|
||||||
$data['remark'] = '接口错误';
|
$data['remark'] = '接口错误';
|
||||||
$error = true;
|
$error = true;
|
||||||
}
|
}
|
||||||
ActivityCouponLog::create($data);
|
|
||||||
|
ActivityCouponLog::create($data);
|
||||||
if ($error) {
|
|
||||||
throw new RuntimeException($data['remark']);
|
if ($error) {
|
||||||
}
|
throw new RuntimeException($data['remark']);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
|
}
|
||||||
}
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,137 +1,149 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use App\Models\Traits\BelongsToUser;
|
use App\Models\Traits\BelongsToUser;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
class Activity extends Model
|
class Activity extends Model
|
||||||
{
|
{
|
||||||
|
|
||||||
use BelongsToUser;
|
use BelongsToUser;
|
||||||
|
|
||||||
const TYPE_EXTEND = 1;
|
protected $dates = [
|
||||||
const TYPE_SCOPE = 2;
|
'start_at',
|
||||||
const TYPES = [
|
'end_at',
|
||||||
self::TYPE_EXTEND => '延期',
|
];
|
||||||
self::TYPE_SCOPE => '固定',
|
|
||||||
];
|
const TYPE_EXTEND = 1;
|
||||||
|
const TYPE_SCOPE = 2;
|
||||||
const STATUS_OPEN = 1;
|
const TYPES = [
|
||||||
const STATUS_CLOSE = 0;
|
self::TYPE_EXTEND => '延期',
|
||||||
const STATUS = [
|
self::TYPE_SCOPE => '固定',
|
||||||
self::STATUS_OPEN => '正常',
|
];
|
||||||
self::STATUS_CLOSE => '关闭',
|
|
||||||
];
|
const STATUS_OPEN = 1;
|
||||||
|
const STATUS_CLOSE = 0;
|
||||||
protected $dates = [
|
const STATUS = [
|
||||||
'start_at',
|
self::STATUS_OPEN => '正常',
|
||||||
'end_at',
|
self::STATUS_CLOSE => '关闭',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
const CHANNEL_YSD = 1;
|
||||||
* 默认加载的关联
|
const CHANNEL_UNION = 2;
|
||||||
* @var array
|
const CHANNELS = [
|
||||||
*/
|
self::CHANNEL_YSD => '亿时代',
|
||||||
protected $with = ['rule'];
|
self::CHANNEL_UNION => '银联',
|
||||||
|
];
|
||||||
protected static function boot(): void
|
|
||||||
{
|
/**
|
||||||
parent::boot();
|
* 默认加载的关联
|
||||||
|
* @var array
|
||||||
self::creating(function ($model) {
|
*/
|
||||||
$model->code = 'ysd' . date('Ym') . mt_rand(100, 999);
|
protected $with = ['rule'];
|
||||||
});
|
|
||||||
}
|
protected static function boot(): void
|
||||||
|
{
|
||||||
//活动类型 固定期限 延期
|
parent::boot();
|
||||||
public function getTypeTextAttribute()
|
|
||||||
{
|
self::creating(function ($model) {
|
||||||
return self::TYPES[$this->type] ?? '未知';
|
$model->code = 'ysd' . date('Ym') . mt_rand(100, 999);
|
||||||
}
|
});
|
||||||
|
}
|
||||||
//活动状态
|
|
||||||
public function getStatusTextAttribute()
|
//活动类型 固定期限 延期
|
||||||
{
|
public function getTypeTextAttribute()
|
||||||
return self::STATUS[$this->status] ?? '未知';
|
{
|
||||||
}
|
return self::TYPES[$this->type] ?? '未知';
|
||||||
|
}
|
||||||
//关联卡券规则 ysd-full100-10
|
|
||||||
public function rule()
|
//活动状态
|
||||||
{
|
public function getStatusTextAttribute(): string
|
||||||
return $this->belongsTo(ActivityRule::class, 'activity_rule_id');
|
{
|
||||||
}
|
return self::STATUS[$this->status] ?? '未知';
|
||||||
|
}
|
||||||
//关联券表
|
|
||||||
public function coupons()
|
//关联卡券规则 ysd-full100-10
|
||||||
{
|
public function rule()
|
||||||
return $this->hasMany(ActivityCoupon::class);
|
{
|
||||||
}
|
return $this->belongsTo(ActivityRule::class, 'activity_rule_id');
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Notes: 关联可发券渠道
|
//关联券表
|
||||||
* @Author: 玄尘
|
public function coupons()
|
||||||
* @Date : 2020/8/21 11:09
|
{
|
||||||
*/
|
return $this->hasMany(ActivityCoupon::class);
|
||||||
public function grants()
|
}
|
||||||
{
|
|
||||||
return $this->hasMany(ActivityGrant::class);
|
/**
|
||||||
|
* Notes: 关联可发券渠道
|
||||||
}
|
* @Author: 玄尘
|
||||||
|
* @Date : 2020/8/21 11:09
|
||||||
/**
|
*/
|
||||||
* Notes: 关联可核销渠道
|
public function grants()
|
||||||
* @Author: 玄尘
|
{
|
||||||
* @Date : 2020/8/21 11:09
|
return $this->hasMany(ActivityGrant::class);
|
||||||
*/
|
|
||||||
public function verifications()
|
}
|
||||||
{
|
|
||||||
return $this->hasMany(ActivityVerification::class);
|
/**
|
||||||
|
* Notes: 关联可核销渠道
|
||||||
}
|
* @Author: 玄尘
|
||||||
|
* @Date : 2020/8/21 11:09
|
||||||
public function canGrant()
|
*/
|
||||||
{
|
public function verifications()
|
||||||
return $this->status;
|
{
|
||||||
}
|
return $this->hasMany(ActivityVerification::class);
|
||||||
|
|
||||||
//发券
|
}
|
||||||
public function grant($mobile, $outletId = null)
|
|
||||||
{
|
public function canGrant()
|
||||||
|
{
|
||||||
try {
|
return $this->status;
|
||||||
$code = 'YSD' . date('ymd') . mt_rand(100000, 999999);
|
}
|
||||||
|
|
||||||
if ($this->type == SELF::TYPE_EXTEND) {
|
//发券
|
||||||
$start_at = now();
|
public function grant($mobile, $outletId = null)
|
||||||
$end_at = now()->addDays($this->days);
|
{
|
||||||
} else {
|
|
||||||
$start_at = $this->start_at->startOfDay();
|
try {
|
||||||
$end_at = $this->end_at->endOfDay();
|
//判断生成何种码
|
||||||
}
|
if ($this->channel == self::CHANNEL_UNION) {
|
||||||
|
$code = '66406' . date('ymdH') . mt_rand(1000000, 9999999);
|
||||||
DB::beginTransaction();
|
} else {
|
||||||
$coupon = ActivityCoupon::create([
|
$code = 'YSD' . date('ymd') . mt_rand(100000, 999999);
|
||||||
'activity_id' => $this->id,
|
}
|
||||||
'code' => $code,
|
|
||||||
'mobile' => $mobile,
|
if ($this->type == SELF::TYPE_EXTEND) {
|
||||||
'outletId' => $outletId,
|
$start_at = now();
|
||||||
'full' => $this->rule->full,
|
$end_at = now()->addDays($this->days);
|
||||||
'price' => $this->rule->take,
|
} else {
|
||||||
'start_at' => $start_at,
|
$start_at = $this->start_at->startOfDay();
|
||||||
'end_at' => $end_at,
|
$end_at = $this->end_at->endOfDay();
|
||||||
'status' => ActivityCoupon::STATUS_INIT,
|
}
|
||||||
]);
|
|
||||||
|
DB::beginTransaction();
|
||||||
DB::commit();
|
$coupon = ActivityCoupon::create([
|
||||||
|
'activity_id' => $this->id,
|
||||||
return $coupon;
|
'code' => $code,
|
||||||
} catch (\Exception $e) {
|
'mobile' => $mobile,
|
||||||
DB::rollback();
|
'outletId' => $outletId,
|
||||||
|
'full' => $this->rule->full,
|
||||||
return $e->getMessage();
|
'price' => $this->rule->take,
|
||||||
}
|
'start_at' => $start_at,
|
||||||
|
'end_at' => $end_at,
|
||||||
}
|
'status' => ActivityCoupon::STATUS_INIT,
|
||||||
|
]);
|
||||||
}
|
|
||||||
|
DB::commit();
|
||||||
|
|
||||||
|
return $coupon;
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
DB::rollback();
|
||||||
|
|
||||||
|
return $e->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -64,4 +64,26 @@ class ActivityCoupon extends Model
|
|||||||
return $this->canRedemption();
|
return $this->canRedemption();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Notes: 是否可以撤销
|
||||||
|
* @Author: 玄尘
|
||||||
|
* @Date : 2020/10/12 11:57
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function canReversal()
|
||||||
|
{
|
||||||
|
return $this->status == self::STATUS_USED;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Notes: 撤销
|
||||||
|
* @Author: 玄尘
|
||||||
|
* @Date : 2020/10/12 13:56
|
||||||
|
*/
|
||||||
|
public function reversal()
|
||||||
|
{
|
||||||
|
$this->status = self::STATUS_INIT;
|
||||||
|
$this->save();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ class Coupon extends Model
|
|||||||
case 4:
|
case 4:
|
||||||
return '已分润';
|
return '已分润';
|
||||||
break;
|
break;
|
||||||
|
case 5:
|
||||||
|
return '已撤销';
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return '未知状态';
|
return '未知状态';
|
||||||
break;
|
break;
|
||||||
@@ -88,6 +91,45 @@ class Coupon extends Model
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Notes: 撤销
|
||||||
|
* @Author: 玄尘
|
||||||
|
* @Date : 2020/10/12 13:56
|
||||||
|
*/
|
||||||
|
public function reversal()
|
||||||
|
{
|
||||||
|
$this->status = 5;
|
||||||
|
$this->remark = '撤销成功';
|
||||||
|
$this->save();
|
||||||
|
|
||||||
|
if ($this->profit > 0) {
|
||||||
|
return $this->user->account->rule('refreeze', -$this->profit, false, [
|
||||||
|
'coupon_id' => $this->id,
|
||||||
|
'redemptionCode' => $this->redemptionCode,
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
return '不需要操作';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Notes: 撤销分润
|
||||||
|
* @Author: 玄尘
|
||||||
|
* @Date : 2020/10/9 14:07
|
||||||
|
*/
|
||||||
|
public function reprofit()
|
||||||
|
{
|
||||||
|
if ($this->profit > 1) {
|
||||||
|
return $this->user->account->rule('refreeze', -$this->profit, false, [
|
||||||
|
'coupon_id' => $this->id,
|
||||||
|
'redemptionCode' => $this->redemptionCode,
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
return '不需要操作';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 打款
|
* 打款
|
||||||
* @author 玄尘 2020-03-13
|
* @author 玄尘 2020-03-13
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
class PinganToken extends Model
|
class PinganToken extends Model
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $dates = [
|
protected $dates = [
|
||||||
'get_token_time',
|
'get_token_time',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -16,14 +16,12 @@ class User extends Authenticatable
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that are mass assignable.
|
* The attributes that are mass assignable.
|
||||||
*
|
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $guarded = [];
|
protected $guarded = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that should be hidden for arrays.
|
* The attributes that should be hidden for arrays.
|
||||||
*
|
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $hidden = [
|
protected $hidden = [
|
||||||
@@ -91,7 +89,7 @@ class User extends Authenticatable
|
|||||||
/**
|
/**
|
||||||
* Notes: 密码加密
|
* Notes: 密码加密
|
||||||
* @Author: <C.Jason>
|
* @Author: <C.Jason>
|
||||||
* @Date: 2019/9/6 11:37
|
* @Date : 2019/9/6 11:37
|
||||||
* @param $password
|
* @param $password
|
||||||
*/
|
*/
|
||||||
protected function setPasswordAttribute($password)
|
protected function setPasswordAttribute($password)
|
||||||
@@ -129,12 +127,12 @@ class User extends Authenticatable
|
|||||||
public function getCouponCount($type, $date = '')
|
public function getCouponCount($type, $date = '')
|
||||||
{
|
{
|
||||||
return $this->coupons()
|
return $this->coupons()
|
||||||
->whereIn('status', [2])
|
->whereIn('status', [2])
|
||||||
->where('thirdPartyGoodsId', $type)
|
->where('thirdPartyGoodsId', $type)
|
||||||
->when($date, function ($q) {
|
->when($date, function ($q) {
|
||||||
$q->whereDate('created_at', now()->format('Y-m-d'));
|
$q->whereDate('created_at', now()->format('Y-m-d'));
|
||||||
})
|
})
|
||||||
->count();
|
->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,10 @@ namespace App\Models;
|
|||||||
|
|
||||||
class UserCode extends Model
|
class UserCode extends Model
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'codes' => 'array',
|
'codes' => 'array',
|
||||||
'profit' => 'array',
|
'profit' => 'array',
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class UserInfo extends Model
|
|||||||
/**
|
/**
|
||||||
* Notes: 获取性别的文字显示
|
* Notes: 获取性别的文字显示
|
||||||
* @Author: <C.Jason>
|
* @Author: <C.Jason>
|
||||||
* @Date: 2019/9/12 09:46
|
* @Date : 2019/9/12 09:46
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function getSexTextAttribute()
|
protected function getSexTextAttribute()
|
||||||
@@ -35,7 +35,7 @@ class UserInfo extends Model
|
|||||||
/**
|
/**
|
||||||
* Notes: 处理默认头像
|
* Notes: 处理默认头像
|
||||||
* @Author: <C.Jason>
|
* @Author: <C.Jason>
|
||||||
* @Date: 2019/9/12 13:44
|
* @Date : 2019/9/12 13:44
|
||||||
* @param $avatar
|
* @param $avatar
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -6,6 +6,6 @@ use App\Models\Traits\BelongsToUser;
|
|||||||
|
|
||||||
class UserPingan extends Model
|
class UserPingan extends Model
|
||||||
{
|
{
|
||||||
use BelongsToUser;
|
|
||||||
|
|
||||||
|
use BelongsToUser;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,10 @@ namespace App\Models;
|
|||||||
|
|
||||||
class WoCouponLog extends Model
|
class WoCouponLog extends Model
|
||||||
{
|
{
|
||||||
|
|
||||||
public function coupon()
|
public function coupon()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(WoCoupon::class, 'wo_coupon_id', 'id');
|
return $this->belongsTo(WoCoupon::class, 'wo_coupon_id', 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
114
bootstrap/cache/packages.php
vendored
114
bootstrap/cache/packages.php
vendored
@@ -1,114 +0,0 @@
|
|||||||
<?php return array (
|
|
||||||
'aslong/sms' =>
|
|
||||||
array (
|
|
||||||
'providers' =>
|
|
||||||
array (
|
|
||||||
0 => 'AsLong\\Sms\\ServiceProvider',
|
|
||||||
),
|
|
||||||
'aliases' =>
|
|
||||||
array (
|
|
||||||
'Sms' => 'AsLong\\Sms\\Facades\\Sms',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'encore/laravel-admin' =>
|
|
||||||
array (
|
|
||||||
'providers' =>
|
|
||||||
array (
|
|
||||||
0 => 'Encore\\Admin\\AdminServiceProvider',
|
|
||||||
),
|
|
||||||
'aliases' =>
|
|
||||||
array (
|
|
||||||
'Admin' => 'Encore\\Admin\\Facades\\Admin',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'facade/ignition' =>
|
|
||||||
array (
|
|
||||||
'providers' =>
|
|
||||||
array (
|
|
||||||
0 => 'Facade\\Ignition\\IgnitionServiceProvider',
|
|
||||||
),
|
|
||||||
'aliases' =>
|
|
||||||
array (
|
|
||||||
'Flare' => 'Facade\\Ignition\\Facades\\Flare',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'fideloper/proxy' =>
|
|
||||||
array (
|
|
||||||
'providers' =>
|
|
||||||
array (
|
|
||||||
0 => 'Fideloper\\Proxy\\TrustedProxyServiceProvider',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'intervention/image' =>
|
|
||||||
array (
|
|
||||||
'providers' =>
|
|
||||||
array (
|
|
||||||
0 => 'Intervention\\Image\\ImageServiceProvider',
|
|
||||||
),
|
|
||||||
'aliases' =>
|
|
||||||
array (
|
|
||||||
'Image' => 'Intervention\\Image\\Facades\\Image',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'laravel-admin-ext/wang-editor' =>
|
|
||||||
array (
|
|
||||||
'providers' =>
|
|
||||||
array (
|
|
||||||
0 => 'Encore\\WangEditor\\WangEditorServiceProvider',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'laravel/tinker' =>
|
|
||||||
array (
|
|
||||||
'providers' =>
|
|
||||||
array (
|
|
||||||
0 => 'Laravel\\Tinker\\TinkerServiceProvider',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'maatwebsite/excel' =>
|
|
||||||
array (
|
|
||||||
'providers' =>
|
|
||||||
array (
|
|
||||||
0 => 'Maatwebsite\\Excel\\ExcelServiceProvider',
|
|
||||||
),
|
|
||||||
'aliases' =>
|
|
||||||
array (
|
|
||||||
'Excel' => 'Maatwebsite\\Excel\\Facades\\Excel',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'nesbot/carbon' =>
|
|
||||||
array (
|
|
||||||
'providers' =>
|
|
||||||
array (
|
|
||||||
0 => 'Carbon\\Laravel\\ServiceProvider',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'nunomaduro/collision' =>
|
|
||||||
array (
|
|
||||||
'providers' =>
|
|
||||||
array (
|
|
||||||
0 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'overtrue/laravel-wechat' =>
|
|
||||||
array (
|
|
||||||
'providers' =>
|
|
||||||
array (
|
|
||||||
0 => 'Overtrue\\LaravelWeChat\\ServiceProvider',
|
|
||||||
),
|
|
||||||
'aliases' =>
|
|
||||||
array (
|
|
||||||
'EasyWeChat' => 'Overtrue\\LaravelWeChat\\Facade',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'simplesoftwareio/simple-qrcode' =>
|
|
||||||
array (
|
|
||||||
'providers' =>
|
|
||||||
array (
|
|
||||||
0 => 'SimpleSoftwareIO\\QrCode\\QrCodeServiceProvider',
|
|
||||||
),
|
|
||||||
'aliases' =>
|
|
||||||
array (
|
|
||||||
'QrCode' => 'SimpleSoftwareIO\\QrCode\\Facades\\QrCode',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
222
bootstrap/cache/services.php
vendored
222
bootstrap/cache/services.php
vendored
@@ -1,222 +0,0 @@
|
|||||||
<?php return array (
|
|
||||||
'providers' =>
|
|
||||||
array (
|
|
||||||
0 => 'Illuminate\\Auth\\AuthServiceProvider',
|
|
||||||
1 => 'Illuminate\\Broadcasting\\BroadcastServiceProvider',
|
|
||||||
2 => 'Illuminate\\Bus\\BusServiceProvider',
|
|
||||||
3 => 'Illuminate\\Cache\\CacheServiceProvider',
|
|
||||||
4 => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
5 => 'Illuminate\\Cookie\\CookieServiceProvider',
|
|
||||||
6 => 'Illuminate\\Database\\DatabaseServiceProvider',
|
|
||||||
7 => 'Illuminate\\Encryption\\EncryptionServiceProvider',
|
|
||||||
8 => 'Illuminate\\Filesystem\\FilesystemServiceProvider',
|
|
||||||
9 => 'Illuminate\\Foundation\\Providers\\FoundationServiceProvider',
|
|
||||||
10 => 'Illuminate\\Hashing\\HashServiceProvider',
|
|
||||||
11 => 'Illuminate\\Mail\\MailServiceProvider',
|
|
||||||
12 => 'Illuminate\\Notifications\\NotificationServiceProvider',
|
|
||||||
13 => 'Illuminate\\Pagination\\PaginationServiceProvider',
|
|
||||||
14 => 'Illuminate\\Pipeline\\PipelineServiceProvider',
|
|
||||||
15 => 'Illuminate\\Queue\\QueueServiceProvider',
|
|
||||||
16 => 'Illuminate\\Redis\\RedisServiceProvider',
|
|
||||||
17 => 'Illuminate\\Auth\\Passwords\\PasswordResetServiceProvider',
|
|
||||||
18 => 'Illuminate\\Session\\SessionServiceProvider',
|
|
||||||
19 => 'Illuminate\\Translation\\TranslationServiceProvider',
|
|
||||||
20 => 'Illuminate\\Validation\\ValidationServiceProvider',
|
|
||||||
21 => 'Illuminate\\View\\ViewServiceProvider',
|
|
||||||
22 => 'AsLong\\Sms\\ServiceProvider',
|
|
||||||
23 => 'Encore\\Admin\\AdminServiceProvider',
|
|
||||||
24 => 'Facade\\Ignition\\IgnitionServiceProvider',
|
|
||||||
25 => 'Fideloper\\Proxy\\TrustedProxyServiceProvider',
|
|
||||||
26 => 'Intervention\\Image\\ImageServiceProvider',
|
|
||||||
27 => 'Encore\\WangEditor\\WangEditorServiceProvider',
|
|
||||||
28 => 'Laravel\\Tinker\\TinkerServiceProvider',
|
|
||||||
29 => 'Maatwebsite\\Excel\\ExcelServiceProvider',
|
|
||||||
30 => 'Carbon\\Laravel\\ServiceProvider',
|
|
||||||
31 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider',
|
|
||||||
32 => 'Overtrue\\LaravelWeChat\\ServiceProvider',
|
|
||||||
33 => 'SimpleSoftwareIO\\QrCode\\QrCodeServiceProvider',
|
|
||||||
34 => 'App\\Providers\\AppServiceProvider',
|
|
||||||
35 => 'App\\Providers\\AuthServiceProvider',
|
|
||||||
36 => 'App\\Providers\\EventServiceProvider',
|
|
||||||
37 => 'App\\Providers\\RouteServiceProvider',
|
|
||||||
38 => 'App\\Api\\ApiServiceProvider',
|
|
||||||
39 => 'App\\Merchant\\MerchantServiceProvider',
|
|
||||||
),
|
|
||||||
'eager' =>
|
|
||||||
array (
|
|
||||||
0 => 'Illuminate\\Auth\\AuthServiceProvider',
|
|
||||||
1 => 'Illuminate\\Cookie\\CookieServiceProvider',
|
|
||||||
2 => 'Illuminate\\Database\\DatabaseServiceProvider',
|
|
||||||
3 => 'Illuminate\\Encryption\\EncryptionServiceProvider',
|
|
||||||
4 => 'Illuminate\\Filesystem\\FilesystemServiceProvider',
|
|
||||||
5 => 'Illuminate\\Foundation\\Providers\\FoundationServiceProvider',
|
|
||||||
6 => 'Illuminate\\Notifications\\NotificationServiceProvider',
|
|
||||||
7 => 'Illuminate\\Pagination\\PaginationServiceProvider',
|
|
||||||
8 => 'Illuminate\\Session\\SessionServiceProvider',
|
|
||||||
9 => 'Illuminate\\View\\ViewServiceProvider',
|
|
||||||
10 => 'AsLong\\Sms\\ServiceProvider',
|
|
||||||
11 => 'Encore\\Admin\\AdminServiceProvider',
|
|
||||||
12 => 'Facade\\Ignition\\IgnitionServiceProvider',
|
|
||||||
13 => 'Fideloper\\Proxy\\TrustedProxyServiceProvider',
|
|
||||||
14 => 'Intervention\\Image\\ImageServiceProvider',
|
|
||||||
15 => 'Encore\\WangEditor\\WangEditorServiceProvider',
|
|
||||||
16 => 'Laravel\\Tinker\\TinkerServiceProvider',
|
|
||||||
17 => 'Maatwebsite\\Excel\\ExcelServiceProvider',
|
|
||||||
18 => 'Carbon\\Laravel\\ServiceProvider',
|
|
||||||
19 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider',
|
|
||||||
20 => 'Overtrue\\LaravelWeChat\\ServiceProvider',
|
|
||||||
21 => 'SimpleSoftwareIO\\QrCode\\QrCodeServiceProvider',
|
|
||||||
22 => 'App\\Providers\\AppServiceProvider',
|
|
||||||
23 => 'App\\Providers\\AuthServiceProvider',
|
|
||||||
24 => 'App\\Providers\\EventServiceProvider',
|
|
||||||
25 => 'App\\Providers\\RouteServiceProvider',
|
|
||||||
26 => 'App\\Api\\ApiServiceProvider',
|
|
||||||
27 => 'App\\Merchant\\MerchantServiceProvider',
|
|
||||||
),
|
|
||||||
'deferred' =>
|
|
||||||
array (
|
|
||||||
'Illuminate\\Broadcasting\\BroadcastManager' => 'Illuminate\\Broadcasting\\BroadcastServiceProvider',
|
|
||||||
'Illuminate\\Contracts\\Broadcasting\\Factory' => 'Illuminate\\Broadcasting\\BroadcastServiceProvider',
|
|
||||||
'Illuminate\\Contracts\\Broadcasting\\Broadcaster' => 'Illuminate\\Broadcasting\\BroadcastServiceProvider',
|
|
||||||
'Illuminate\\Bus\\Dispatcher' => 'Illuminate\\Bus\\BusServiceProvider',
|
|
||||||
'Illuminate\\Contracts\\Bus\\Dispatcher' => 'Illuminate\\Bus\\BusServiceProvider',
|
|
||||||
'Illuminate\\Contracts\\Bus\\QueueingDispatcher' => 'Illuminate\\Bus\\BusServiceProvider',
|
|
||||||
'cache' => 'Illuminate\\Cache\\CacheServiceProvider',
|
|
||||||
'cache.store' => 'Illuminate\\Cache\\CacheServiceProvider',
|
|
||||||
'cache.psr6' => 'Illuminate\\Cache\\CacheServiceProvider',
|
|
||||||
'memcached.connector' => 'Illuminate\\Cache\\CacheServiceProvider',
|
|
||||||
'command.cache.clear' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.cache.forget' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.clear-compiled' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.auth.resets.clear' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.config.cache' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.config.clear' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.db.wipe' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.down' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.environment' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.event.cache' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.event.clear' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.event.list' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.key.generate' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.optimize' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.optimize.clear' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.package.discover' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.preset' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.queue.failed' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.queue.flush' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.queue.forget' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.queue.listen' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.queue.restart' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.queue.retry' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.queue.work' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.route.cache' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.route.clear' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.route.list' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.seed' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'Illuminate\\Console\\Scheduling\\ScheduleFinishCommand' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'Illuminate\\Console\\Scheduling\\ScheduleRunCommand' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.storage.link' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.up' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.view.cache' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.view.clear' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.cache.table' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.channel.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.console.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.controller.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.event.generate' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.event.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.exception.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.factory.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.job.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.listener.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.mail.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.middleware.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.model.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.notification.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.notification.table' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.observer.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.policy.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.provider.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.queue.failed-table' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.queue.table' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.request.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.resource.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.rule.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.seeder.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.session.table' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.serve' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.test.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.vendor.publish' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'migrator' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'migration.repository' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'migration.creator' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.migrate' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.migrate.fresh' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.migrate.install' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.migrate.refresh' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.migrate.reset' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.migrate.rollback' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.migrate.status' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'command.migrate.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'composer' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
|
|
||||||
'hash' => 'Illuminate\\Hashing\\HashServiceProvider',
|
|
||||||
'hash.driver' => 'Illuminate\\Hashing\\HashServiceProvider',
|
|
||||||
'mailer' => 'Illuminate\\Mail\\MailServiceProvider',
|
|
||||||
'swift.mailer' => 'Illuminate\\Mail\\MailServiceProvider',
|
|
||||||
'swift.transport' => 'Illuminate\\Mail\\MailServiceProvider',
|
|
||||||
'Illuminate\\Mail\\Markdown' => 'Illuminate\\Mail\\MailServiceProvider',
|
|
||||||
'Illuminate\\Contracts\\Pipeline\\Hub' => 'Illuminate\\Pipeline\\PipelineServiceProvider',
|
|
||||||
'queue' => 'Illuminate\\Queue\\QueueServiceProvider',
|
|
||||||
'queue.worker' => 'Illuminate\\Queue\\QueueServiceProvider',
|
|
||||||
'queue.listener' => 'Illuminate\\Queue\\QueueServiceProvider',
|
|
||||||
'queue.failer' => 'Illuminate\\Queue\\QueueServiceProvider',
|
|
||||||
'queue.connection' => 'Illuminate\\Queue\\QueueServiceProvider',
|
|
||||||
'redis' => 'Illuminate\\Redis\\RedisServiceProvider',
|
|
||||||
'redis.connection' => 'Illuminate\\Redis\\RedisServiceProvider',
|
|
||||||
'auth.password' => 'Illuminate\\Auth\\Passwords\\PasswordResetServiceProvider',
|
|
||||||
'auth.password.broker' => 'Illuminate\\Auth\\Passwords\\PasswordResetServiceProvider',
|
|
||||||
'translator' => 'Illuminate\\Translation\\TranslationServiceProvider',
|
|
||||||
'translation.loader' => 'Illuminate\\Translation\\TranslationServiceProvider',
|
|
||||||
'validator' => 'Illuminate\\Validation\\ValidationServiceProvider',
|
|
||||||
'validation.presence' => 'Illuminate\\Validation\\ValidationServiceProvider',
|
|
||||||
),
|
|
||||||
'when' =>
|
|
||||||
array (
|
|
||||||
'Illuminate\\Broadcasting\\BroadcastServiceProvider' =>
|
|
||||||
array (
|
|
||||||
),
|
|
||||||
'Illuminate\\Bus\\BusServiceProvider' =>
|
|
||||||
array (
|
|
||||||
),
|
|
||||||
'Illuminate\\Cache\\CacheServiceProvider' =>
|
|
||||||
array (
|
|
||||||
),
|
|
||||||
'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider' =>
|
|
||||||
array (
|
|
||||||
),
|
|
||||||
'Illuminate\\Hashing\\HashServiceProvider' =>
|
|
||||||
array (
|
|
||||||
),
|
|
||||||
'Illuminate\\Mail\\MailServiceProvider' =>
|
|
||||||
array (
|
|
||||||
),
|
|
||||||
'Illuminate\\Pipeline\\PipelineServiceProvider' =>
|
|
||||||
array (
|
|
||||||
),
|
|
||||||
'Illuminate\\Queue\\QueueServiceProvider' =>
|
|
||||||
array (
|
|
||||||
),
|
|
||||||
'Illuminate\\Redis\\RedisServiceProvider' =>
|
|
||||||
array (
|
|
||||||
),
|
|
||||||
'Illuminate\\Auth\\Passwords\\PasswordResetServiceProvider' =>
|
|
||||||
array (
|
|
||||||
),
|
|
||||||
'Illuminate\\Translation\\TranslationServiceProvider' =>
|
|
||||||
array (
|
|
||||||
),
|
|
||||||
'Illuminate\\Validation\\ValidationServiceProvider' =>
|
|
||||||
array (
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
@@ -9,6 +9,7 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.2",
|
"php": "^7.2",
|
||||||
|
"barryvdh/laravel-debugbar": "^3.4",
|
||||||
"encore/laravel-admin": "^1.8",
|
"encore/laravel-admin": "^1.8",
|
||||||
"fideloper/proxy": "^4.0",
|
"fideloper/proxy": "^4.0",
|
||||||
"guzzlehttp/guzzle": "^7.0",
|
"guzzlehttp/guzzle": "^7.0",
|
||||||
@@ -16,17 +17,21 @@
|
|||||||
"laravel-admin-ext/wang-editor": "^1.1",
|
"laravel-admin-ext/wang-editor": "^1.1",
|
||||||
"laravel/framework": "^6.2",
|
"laravel/framework": "^6.2",
|
||||||
"laravel/tinker": "^1.0",
|
"laravel/tinker": "^1.0",
|
||||||
|
"league/flysystem-sftp": "1.0.22",
|
||||||
"maatwebsite/excel": "^3.1",
|
"maatwebsite/excel": "^3.1",
|
||||||
"php-parallel-lint/php-console-color": "^0.3.0",
|
"php-parallel-lint/php-console-color": "^0.3.0",
|
||||||
"php-parallel-lint/php-console-highlighter": "^0.5.0",
|
"php-parallel-lint/php-console-highlighter": "^0.5.0",
|
||||||
"predis/predis": "^1.1",
|
"predis/predis": "^1.1",
|
||||||
"simplesoftwareio/simple-qrcode": "^2.0"
|
"simplesoftwareio/simple-qrcode": "^2.0",
|
||||||
|
"xuanchen/coupon": "^1.0",
|
||||||
|
"xuanchen/unionpay": "^2.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"facade/ignition": "^1.4",
|
"facade/ignition": "^1.4",
|
||||||
"fzaninotto/faker": "^1.4",
|
"fzaninotto/faker": "^1.4",
|
||||||
"mockery/mockery": "^1.0",
|
"mockery/mockery": "^1.0",
|
||||||
"nunomaduro/collision": "^3.0",
|
"nunomaduro/collision": "^3.0",
|
||||||
|
"overtrue/laravel-query-logger": "^2.0",
|
||||||
"phpunit/phpunit": "^8.0"
|
"phpunit/phpunit": "^8.0"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
@@ -43,11 +48,11 @@
|
|||||||
"psr-4": {
|
"psr-4": {
|
||||||
"App\\": "app/",
|
"App\\": "app/",
|
||||||
"RuLong\\Bonus\\": "packages/bonus/src/",
|
"RuLong\\Bonus\\": "packages/bonus/src/",
|
||||||
"RuLong\\Identity\\": "packages/identity/src/",
|
"RuLong\\Identity\\": "packages/identity/src/"
|
||||||
"XuanChen\\Coupon\\": "packages/coupon/src/"
|
|
||||||
},
|
},
|
||||||
"classmap": [
|
"classmap": [
|
||||||
"database/seeds",
|
"database/seeds",
|
||||||
|
"database/migrations",
|
||||||
"database/factories"
|
"database/factories"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
3952
composer.lock
generated
3952
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,15 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
return [
|
|
||||||
'rules' => [
|
|
||||||
'pingan' => [
|
|
||||||
'pattern' => '/^\d{12}$/',
|
|
||||||
'model' => App\Facades\SelfCoupon\Action\PinganAction::class,
|
|
||||||
],
|
|
||||||
'ysd' => [
|
|
||||||
'pattern' => '/^YSD/',
|
|
||||||
'model' => App\Facades\SelfCoupon\Action\YsdAction::class,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
'check_minutes' => 3,//统一门店同一金额 3 分钟内视为同一订单
|
|
||||||
];
|
|
||||||
@@ -36,36 +36,36 @@ return [
|
|||||||
|
|
||||||
'channels' => [
|
'channels' => [
|
||||||
'stack' => [
|
'stack' => [
|
||||||
'driver' => 'stack',
|
'driver' => 'stack',
|
||||||
'channels' => ['daily'],
|
'channels' => ['daily'],
|
||||||
'ignore_exceptions' => false,
|
'ignore_exceptions' => false,
|
||||||
],
|
],
|
||||||
|
|
||||||
'single' => [
|
'single' => [
|
||||||
'driver' => 'single',
|
'driver' => 'single',
|
||||||
'path' => storage_path('logs/laravel.log'),
|
'path' => storage_path('logs/laravel.log'),
|
||||||
'level' => 'debug',
|
'level' => 'debug',
|
||||||
],
|
],
|
||||||
|
|
||||||
'daily' => [
|
'daily' => [
|
||||||
'driver' => 'daily',
|
'driver' => 'daily',
|
||||||
'path' => storage_path('logs/laravel.log'),
|
'path' => storage_path('logs/laravel.log'),
|
||||||
'level' => 'debug',
|
'level' => 'debug',
|
||||||
'days' => 14,
|
'days' => 14,
|
||||||
],
|
],
|
||||||
|
|
||||||
'slack' => [
|
'slack' => [
|
||||||
'driver' => 'slack',
|
'driver' => 'slack',
|
||||||
'url' => env('LOG_SLACK_WEBHOOK_URL'),
|
'url' => env('LOG_SLACK_WEBHOOK_URL'),
|
||||||
'username' => 'Laravel Log',
|
'username' => 'Laravel Log',
|
||||||
'emoji' => ':boom:',
|
'emoji' => ':boom:',
|
||||||
'level' => 'critical',
|
'level' => 'critical',
|
||||||
],
|
],
|
||||||
|
|
||||||
'papertrail' => [
|
'papertrail' => [
|
||||||
'driver' => 'monolog',
|
'driver' => 'monolog',
|
||||||
'level' => 'debug',
|
'level' => 'debug',
|
||||||
'handler' => SyslogUdpHandler::class,
|
'handler' => SyslogUdpHandler::class,
|
||||||
'handler_with' => [
|
'handler_with' => [
|
||||||
'host' => env('PAPERTRAIL_URL'),
|
'host' => env('PAPERTRAIL_URL'),
|
||||||
'port' => env('PAPERTRAIL_PORT'),
|
'port' => env('PAPERTRAIL_PORT'),
|
||||||
@@ -73,28 +73,35 @@ return [
|
|||||||
],
|
],
|
||||||
|
|
||||||
'stderr' => [
|
'stderr' => [
|
||||||
'driver' => 'monolog',
|
'driver' => 'monolog',
|
||||||
'handler' => StreamHandler::class,
|
'handler' => StreamHandler::class,
|
||||||
'formatter' => env('LOG_STDERR_FORMATTER'),
|
'formatter' => env('LOG_STDERR_FORMATTER'),
|
||||||
'with' => [
|
'with' => [
|
||||||
'stream' => 'php://stderr',
|
'stream' => 'php://stderr',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
'syslog' => [
|
'syslog' => [
|
||||||
'driver' => 'syslog',
|
'driver' => 'syslog',
|
||||||
'level' => 'debug',
|
'level' => 'debug',
|
||||||
],
|
],
|
||||||
|
|
||||||
'errorlog' => [
|
'errorlog' => [
|
||||||
'driver' => 'errorlog',
|
'driver' => 'errorlog',
|
||||||
'level' => 'debug',
|
'level' => 'debug',
|
||||||
],
|
],
|
||||||
|
|
||||||
'null' => [
|
'null' => [
|
||||||
'driver' => 'monolog',
|
'driver' => 'monolog',
|
||||||
'handler' => NullHandler::class,
|
'handler' => NullHandler::class,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
'query' => [
|
||||||
|
'enabled' => env('LOG_QUERY', false),
|
||||||
|
|
||||||
|
// Only record queries that are slower than the following time
|
||||||
|
// Unit: milliseconds
|
||||||
|
'slower_than' => 0,
|
||||||
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -46,4 +46,9 @@ return [
|
|||||||
7 => '未激活',
|
7 => '未激活',
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'froms' => [
|
||||||
|
'bsshop',//本时商城
|
||||||
|
'bslive',//本时生活
|
||||||
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|||||||
42
config/sinopec.php
Normal file
42
config/sinopec.php
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
/**
|
||||||
|
* 平安接口参数
|
||||||
|
*/
|
||||||
|
'this_type' => 'dev',
|
||||||
|
/**
|
||||||
|
* 测试环境参数
|
||||||
|
*/
|
||||||
|
'test' => [
|
||||||
|
'client_id' => 'P_YISHIDAI',
|
||||||
|
'grant_type' => 'client_credentials',
|
||||||
|
'client_secret' => 'zGg9e6J5',
|
||||||
|
'userName' => '18804518018',
|
||||||
|
'AES_CODE' => '61DA0376BEBCFE1F',
|
||||||
|
'tokenUri' => 'https://test-api.pingan.com.cn:20443/oauth/oauth2/access_token',
|
||||||
|
'Uri' => 'http://test-api.pingan.com.cn:20080/open/vassPartner/appsvr/property/api/new/',
|
||||||
|
],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产环境参数
|
||||||
|
*/
|
||||||
|
'dev' => [
|
||||||
|
'client_id' => 'P_YISHIDAI',
|
||||||
|
'grant_type' => 'client_credentials',
|
||||||
|
'client_secret' => 'F3j5J7bx',
|
||||||
|
'userName' => '13936166646',
|
||||||
|
'AES_CODE' => '108DD27AB83252DB',
|
||||||
|
'tokenUri' => 'http://api.pingan.com.cn/oauth/oauth2/access_token',
|
||||||
|
'Uri' => 'http://api.pingan.com.cn/open/vassPartner/appsvr/property/api/new/',
|
||||||
|
],
|
||||||
|
|
||||||
|
'coupon_status' => [
|
||||||
|
1 => '新建',
|
||||||
|
2 => '未生效',
|
||||||
|
3 => '生效',
|
||||||
|
4 => '失效',
|
||||||
|
5 => '过期',
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
||||||
687
config/unionpay.php
Normal file
687
config/unionpay.php
Normal file
@@ -0,0 +1,687 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
//环境变量
|
||||||
|
'this_type' => 'test',
|
||||||
|
//添加日志
|
||||||
|
'log' => true,
|
||||||
|
//对账单信息
|
||||||
|
'check' => [
|
||||||
|
'sftpadapter' => [
|
||||||
|
'host' => 'localhost',//地址
|
||||||
|
'port' => 22,//端口
|
||||||
|
'username' => 'root', //账号
|
||||||
|
'password' => 'Anetadmin1',//密码
|
||||||
|
'privateKey' => '',
|
||||||
|
'passphrase' => '',
|
||||||
|
'root' => '/home/wwwroot/pingan/upload/',//路径
|
||||||
|
'timeout' => 10,//超时时间
|
||||||
|
'directoryPerm' => 0755,
|
||||||
|
],
|
||||||
|
'type' => 'JYMX',
|
||||||
|
'file_type' => 'txt',
|
||||||
|
],
|
||||||
|
//获取微信侧的优惠券
|
||||||
|
'unionpay_url' => [
|
||||||
|
'test' => [
|
||||||
|
'code' => 'http://dev.spserv.yxlm.chinaums.com:25941/spapigateway/v2/markting/sp/coupon/order/get',
|
||||||
|
],
|
||||||
|
'dev' => [
|
||||||
|
'code' => 'https://mktos.chinaums.com/spapigateway/v2/markting/sp/coupon/order/get',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
//不进行sign校验
|
||||||
|
'nosign' => [
|
||||||
|
// '002025',//查询
|
||||||
|
// '002100',//核销
|
||||||
|
// '002101',//冲正
|
||||||
|
// '002102',//撤销
|
||||||
|
'openid',//获取openid 封装数据
|
||||||
|
'code',//微信测获取优惠券
|
||||||
|
],
|
||||||
|
//分配的渠道号
|
||||||
|
'msg_sender' => '660134',
|
||||||
|
//打印在小票上,由活动标题、优惠金额、原始金额组合而成
|
||||||
|
'pos_receipt' => '本时生活,优惠生活',
|
||||||
|
//广告,用于打印在小票上
|
||||||
|
'pos_ad' => '',
|
||||||
|
//营销联盟广告,用于打印在小票上
|
||||||
|
'pos_mkt_ad' => '本时生活,优惠生活',
|
||||||
|
//银联渠道id
|
||||||
|
'agent_id' => '299',
|
||||||
|
//银联网点id
|
||||||
|
'outlet_id' => '2009300919918',
|
||||||
|
//用于银商与sp分润的金额(是佣金的一部分), 以分为单位
|
||||||
|
'serv_chg' => 0,
|
||||||
|
//佣金
|
||||||
|
'commission' => 0,
|
||||||
|
//证书
|
||||||
|
'certificate' => [
|
||||||
|
'dev' => [
|
||||||
|
'ysd' => [
|
||||||
|
'private' => storage_path('cert/unionpay/dev/ysd/private_rsa.pem'),
|
||||||
|
'public' => storage_path('cert/unionpay/dev/ysd/public_rsa.pem'),
|
||||||
|
],
|
||||||
|
'union' => [
|
||||||
|
'public' => storage_path('cert/unionpay/dev/union/public_rsa.pem'),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'test' => [
|
||||||
|
'ysd' => [
|
||||||
|
'private' => storage_path('cert/unionpay/test/ysd/private_rsa.pem'),
|
||||||
|
'public' => storage_path('cert/unionpay/test/ysd/public_rsa.pem'),
|
||||||
|
],
|
||||||
|
'union' => [
|
||||||
|
'public' => storage_path('cert/unionpay/test/union/public_rsa.pem'),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
//接口类型
|
||||||
|
'type' => [
|
||||||
|
'002025' => '查询',
|
||||||
|
'002100' => '交易',
|
||||||
|
'002101' => '冲正',
|
||||||
|
'002102' => '撤销',
|
||||||
|
'openid' => '封装openid参数',
|
||||||
|
'106040' => '领券',
|
||||||
|
'012100' => '核销通知',
|
||||||
|
'code' => '生活请求发券',
|
||||||
|
],
|
||||||
|
//日志类型对应
|
||||||
|
'log_type' => [
|
||||||
|
'002025' => 'query',
|
||||||
|
'002100' => 'freezecoupon',
|
||||||
|
'002101' => 'reversal',
|
||||||
|
'002102' => 'annul',
|
||||||
|
'openid' => 'openid',
|
||||||
|
'106040' => 'getcode',
|
||||||
|
'012100' => 'notify',
|
||||||
|
],
|
||||||
|
// 签名检查数据 没有为全数据
|
||||||
|
'checksign' => [
|
||||||
|
'default' => [
|
||||||
|
'in' => [
|
||||||
|
'msg_type',
|
||||||
|
'msg_txn_code',
|
||||||
|
'msg_crrltn_id',
|
||||||
|
'msg_flg',
|
||||||
|
'msg_sender',
|
||||||
|
'msg_time',
|
||||||
|
'msg_sys_sn',
|
||||||
|
'msg_ver',
|
||||||
|
'sign_type',
|
||||||
|
],
|
||||||
|
'out' => [
|
||||||
|
'msg_type',
|
||||||
|
'msg_txn_code',
|
||||||
|
'msg_crrltn_id',
|
||||||
|
'msg_flg',
|
||||||
|
'msg_sender',
|
||||||
|
'msg_sys_sn',
|
||||||
|
'msg_time',
|
||||||
|
'msg_ver',
|
||||||
|
'msg_rsp_code',
|
||||||
|
'msg_rsp_desc',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'106040' => [
|
||||||
|
'in' => [
|
||||||
|
'msg_type',
|
||||||
|
'msg_txn_code',
|
||||||
|
'msg_crrltn_id',
|
||||||
|
'msg_flg',
|
||||||
|
'msg_sender',
|
||||||
|
'msg_time',
|
||||||
|
'msg_sys_sn',
|
||||||
|
'msg_ver',
|
||||||
|
'sign_type',
|
||||||
|
],
|
||||||
|
'out' => [
|
||||||
|
'msg_type',
|
||||||
|
'msg_txn_code',
|
||||||
|
'msg_crrltn_id',
|
||||||
|
'msg_flg',
|
||||||
|
'msg_sender',
|
||||||
|
'msg_sys_sn',
|
||||||
|
'msg_time',
|
||||||
|
'msg_ver',
|
||||||
|
'msg_rsp_code',
|
||||||
|
'msg_rsp_desc',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'012100' => [
|
||||||
|
'in' => [
|
||||||
|
'msg_type',
|
||||||
|
'msg_txn_code',
|
||||||
|
'msg_crrltn_id',
|
||||||
|
'msg_flg',
|
||||||
|
'msg_sender',
|
||||||
|
'msg_time',
|
||||||
|
'msg_sys_sn',
|
||||||
|
'msg_ver',
|
||||||
|
],
|
||||||
|
'out' => [
|
||||||
|
'msg_type',
|
||||||
|
'msg_txn_code',
|
||||||
|
'msg_crrltn_id',
|
||||||
|
'msg_flg',
|
||||||
|
'msg_sender',
|
||||||
|
'msg_time',
|
||||||
|
'msg_sys_sn',
|
||||||
|
'msg_ver',
|
||||||
|
'msg_rsp_code',
|
||||||
|
'msg_rsp_desc',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
//需要校验的数据
|
||||||
|
'validator' => [
|
||||||
|
'002025' => [
|
||||||
|
"msg_type",
|
||||||
|
"msg_txn_code",
|
||||||
|
"msg_crrltn_id",
|
||||||
|
"msg_flg",
|
||||||
|
"msg_sender",
|
||||||
|
"msg_time",
|
||||||
|
"msg_ver",
|
||||||
|
"msg_sys_sn",
|
||||||
|
"req_serial_no",
|
||||||
|
"mkt_code",
|
||||||
|
"amount",
|
||||||
|
"avl_amt",
|
||||||
|
],
|
||||||
|
'002100' => [
|
||||||
|
"msg_type",
|
||||||
|
"msg_txn_code",
|
||||||
|
"msg_crrltn_id",
|
||||||
|
"msg_flg",
|
||||||
|
"msg_sender",
|
||||||
|
"msg_time",
|
||||||
|
"msg_sys_sn",
|
||||||
|
"msg_ver",
|
||||||
|
"req_serial_no",
|
||||||
|
"orig_req_serial_no",
|
||||||
|
"sett_date",
|
||||||
|
"txn_date",
|
||||||
|
"txn_time",
|
||||||
|
"orig_amt",
|
||||||
|
"discount_amt",
|
||||||
|
],
|
||||||
|
'002101' => [
|
||||||
|
"msg_type",
|
||||||
|
"msg_txn_code",
|
||||||
|
"msg_crrltn_id",
|
||||||
|
"msg_flg",
|
||||||
|
"msg_sender",
|
||||||
|
"msg_time",
|
||||||
|
"msg_sys_sn",
|
||||||
|
"msg_ver",
|
||||||
|
"req_serial_no",
|
||||||
|
"orig_req_serial_no",
|
||||||
|
],
|
||||||
|
'002102' => [
|
||||||
|
"msg_type",
|
||||||
|
"msg_txn_code",
|
||||||
|
"msg_crrltn_id",
|
||||||
|
"msg_flg",
|
||||||
|
"msg_sender",
|
||||||
|
"msg_time",
|
||||||
|
"msg_sys_sn",
|
||||||
|
"msg_ver",
|
||||||
|
"req_serial_no",
|
||||||
|
"orig_req_serial_no",
|
||||||
|
],
|
||||||
|
//封装openid参数
|
||||||
|
'openid' => [
|
||||||
|
"msg_type",
|
||||||
|
"msg_txn_code",
|
||||||
|
"msg_crrltn_id",
|
||||||
|
"msg_sender",
|
||||||
|
"callback_type",
|
||||||
|
"callback_url",
|
||||||
|
],
|
||||||
|
//本时生活领券
|
||||||
|
'code' => [
|
||||||
|
"msg_type",
|
||||||
|
"msg_txn_code",
|
||||||
|
"msg_crrltn_id",
|
||||||
|
"msg_sender",
|
||||||
|
"issue_user_id",
|
||||||
|
"event_no",
|
||||||
|
"mobile",
|
||||||
|
],
|
||||||
|
|
||||||
|
//本时生活领券
|
||||||
|
'106040' => [
|
||||||
|
'msg_type',
|
||||||
|
'msg_txn_code',
|
||||||
|
'msg_crrltn_id',
|
||||||
|
// 'msg_flg',
|
||||||
|
'msg_sender',
|
||||||
|
'msg_time',
|
||||||
|
'msg_sys_sn',
|
||||||
|
'msg_ver',
|
||||||
|
'sp_chnl_no',
|
||||||
|
'sp_order_no',
|
||||||
|
'order_date',
|
||||||
|
'event_no',
|
||||||
|
'issue_user_id',
|
||||||
|
],
|
||||||
|
//回调核销信息 校验数据项目
|
||||||
|
'012100' => [
|
||||||
|
'msg_type',
|
||||||
|
'msg_txn_code',
|
||||||
|
'msg_crrltn_id',
|
||||||
|
'msg_flg',
|
||||||
|
'msg_sender',
|
||||||
|
'msg_time',
|
||||||
|
'msg_sys_sn',
|
||||||
|
'msg_ver',
|
||||||
|
'mchnt_no',
|
||||||
|
'term_no',
|
||||||
|
'shop_no',
|
||||||
|
'req_serial_no',
|
||||||
|
'coupon_no',
|
||||||
|
'coupon_type',
|
||||||
|
'enc_card_no',
|
||||||
|
'acq_term_sn',
|
||||||
|
'refer_no',
|
||||||
|
'sett_date',
|
||||||
|
'txn_date',
|
||||||
|
'txn_time',
|
||||||
|
'orig_amt',
|
||||||
|
'discount_amt',
|
||||||
|
'pay_amt',
|
||||||
|
'pay_mode',
|
||||||
|
'event_no',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
//入库基础数据
|
||||||
|
'regular' => [
|
||||||
|
'002025' => [
|
||||||
|
"msg_type",
|
||||||
|
"msg_txn_code",
|
||||||
|
"msg_crrltn_id",
|
||||||
|
// "msg_flg",
|
||||||
|
"msg_sender",
|
||||||
|
"msg_time",
|
||||||
|
"msg_ver",
|
||||||
|
"msg_sys_sn",//自己添加的基础数据
|
||||||
|
"req_serial_no",//自己添加的基础数据
|
||||||
|
"mkt_code",//自己添加的基础数据
|
||||||
|
],
|
||||||
|
'002100' => [
|
||||||
|
"msg_type",
|
||||||
|
"msg_txn_code",
|
||||||
|
"msg_crrltn_id",
|
||||||
|
// "msg_flg",
|
||||||
|
"msg_sender",
|
||||||
|
"msg_time",
|
||||||
|
"msg_sys_sn",
|
||||||
|
"msg_ver",
|
||||||
|
"req_serial_no",//自己添加的基础数据
|
||||||
|
"orig_req_serial_no",//自己添加的基础数据
|
||||||
|
"sett_date",//自己添加的基础数据
|
||||||
|
],
|
||||||
|
'002101' => [
|
||||||
|
"msg_type",
|
||||||
|
"msg_txn_code",
|
||||||
|
"msg_crrltn_id",
|
||||||
|
// "msg_flg",
|
||||||
|
"msg_sender",
|
||||||
|
"msg_time",
|
||||||
|
"msg_sys_sn",
|
||||||
|
"msg_ver",
|
||||||
|
"req_serial_no",//自己添加的基础数据
|
||||||
|
"orig_req_serial_no",//自己添加的基础数据
|
||||||
|
],
|
||||||
|
'002102' => [
|
||||||
|
"msg_type",
|
||||||
|
"msg_txn_code",
|
||||||
|
"msg_crrltn_id",
|
||||||
|
// "msg_flg",
|
||||||
|
"msg_sender",
|
||||||
|
"msg_time",
|
||||||
|
"msg_sys_sn",
|
||||||
|
"msg_ver",
|
||||||
|
"req_serial_no",//自己添加的基础数据
|
||||||
|
"orig_req_serial_no",//自己添加的基础数据
|
||||||
|
],
|
||||||
|
//封装获取openid数据
|
||||||
|
'openid' => [
|
||||||
|
"msg_type",
|
||||||
|
"msg_txn_code",
|
||||||
|
"msg_crrltn_id",
|
||||||
|
"msg_sender",
|
||||||
|
],
|
||||||
|
//本时生活领券
|
||||||
|
'code' => [
|
||||||
|
"msg_type",
|
||||||
|
"msg_txn_code",
|
||||||
|
"msg_crrltn_id",
|
||||||
|
"msg_sender",
|
||||||
|
],
|
||||||
|
//去联盟领券
|
||||||
|
'106040' => [
|
||||||
|
'msg_type',
|
||||||
|
'msg_txn_code',
|
||||||
|
'msg_crrltn_id',
|
||||||
|
// 'msg_flg',
|
||||||
|
'msg_sender',
|
||||||
|
'msg_time',
|
||||||
|
'msg_sys_sn',
|
||||||
|
'msg_ver',
|
||||||
|
],
|
||||||
|
//回调核销信息
|
||||||
|
'012100' => [
|
||||||
|
'msg_type',
|
||||||
|
'msg_txn_code',
|
||||||
|
'msg_crrltn_id',
|
||||||
|
'msg_sender',
|
||||||
|
'msg_time',
|
||||||
|
'msg_sys_sn',
|
||||||
|
'msg_ver',
|
||||||
|
'req_serial_no',
|
||||||
|
'sett_date',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'fields' => [
|
||||||
|
//聚合营销优惠查询接口
|
||||||
|
'002025' => [
|
||||||
|
'in' => [
|
||||||
|
"msg_type" => "报文类型",
|
||||||
|
"msg_txn_code" => "交易代码",
|
||||||
|
"msg_crrltn_id" => "报文流水号",
|
||||||
|
"msg_flg" => "报文请求应答标志",
|
||||||
|
"msg_sender" => "报文发送方",
|
||||||
|
"msg_time" => "报文日期",
|
||||||
|
"msg_sys_sn" => "平台流水号",
|
||||||
|
"msg_ver" => "报文版本号",
|
||||||
|
"req_serial_no" => "查询流水号",
|
||||||
|
"shop_no" => "门店号",
|
||||||
|
"term_no" => "受理终端号",
|
||||||
|
"service_code" => "受理方式",
|
||||||
|
"voucher_no" => "受理凭证号",
|
||||||
|
"mkt_code" => "聚合营销码",
|
||||||
|
"mkt_mode" => "聚合营销类型",
|
||||||
|
"embedded_mchnt_no" => "发起渠道商户号",
|
||||||
|
"currency_code" => "货币代码",
|
||||||
|
"amount" => "消费金额",
|
||||||
|
"avl_amt" => "可优惠金额",
|
||||||
|
"term_sp_chnl_no" => "终端指定SP渠道号",
|
||||||
|
"func_code" => "功能码",
|
||||||
|
"times" => "次数",
|
||||||
|
"pay_mode" => "支付方式",
|
||||||
|
//用户附加信息
|
||||||
|
"user_ext_info" => [
|
||||||
|
"mobile_no" => "手机号",
|
||||||
|
"user_code" => "用户号",
|
||||||
|
"user_code_type" => "用户号类型",
|
||||||
|
"dev_id" => "设备id",
|
||||||
|
],
|
||||||
|
"sign" => "签名域",
|
||||||
|
],
|
||||||
|
'out' => [
|
||||||
|
"msg_type" => "报文类型",
|
||||||
|
"msg_txn_code" => "交易代码",
|
||||||
|
"msg_crrltn_id" => "报文流水号",
|
||||||
|
"msg_flg" => "报文请求应答标志",
|
||||||
|
"msg_sender" => "报文发送方",
|
||||||
|
"msg_time" => "报文日期",
|
||||||
|
"msg_sys_sn" => "平台流水号",
|
||||||
|
"msg_rsp_code" => "响应码",
|
||||||
|
"msg_rsp_desc" => "响应码描述",
|
||||||
|
"discount" => "折扣金额",
|
||||||
|
"actual_amt" => "折后应收金额",
|
||||||
|
"pos_display" => "POS显示",
|
||||||
|
"pos_receipt" => "POS小票",
|
||||||
|
"pos_ad" => "POS广告",
|
||||||
|
"pos_mkt_ad" => "Pos_营销联盟广告",
|
||||||
|
"sign" => "签名域",
|
||||||
|
],
|
||||||
|
],
|
||||||
|
//销账交易接口
|
||||||
|
'002100' => [
|
||||||
|
'in' => [
|
||||||
|
"msg_type" => "报文类型",
|
||||||
|
"msg_txn_code" => "交易代码",
|
||||||
|
"msg_crrltn_id" => "消息关联号",
|
||||||
|
"msg_flg" => "报文请求应答标志",
|
||||||
|
"msg_sender" => "报文发送方",
|
||||||
|
"msg_time" => "报文日期",
|
||||||
|
"msg_sys_sn" => "平台流水号",
|
||||||
|
"msg_ver" => "报文版本号",
|
||||||
|
"shop_no" => "门店号",
|
||||||
|
"term_no" => "终端号",
|
||||||
|
"req_serial_no" => "销券流水号",
|
||||||
|
"orig_req_serial_no" => "原查询流水号",
|
||||||
|
"enc_card_no" => "加密卡号",
|
||||||
|
"part_card_no" => "部分卡号",
|
||||||
|
"acq_term_sn" => "受理终端流水号",
|
||||||
|
"refer_no" => "检索参考号",
|
||||||
|
"sett_date" => "清算日期",
|
||||||
|
"txn_date" => "交易日期",
|
||||||
|
"txn_time" => "交易时间",
|
||||||
|
"orig_amt" => "原始金额",
|
||||||
|
"discount_amt" => "优惠的金额",
|
||||||
|
"pay_amt" => "支付金额",
|
||||||
|
"pay_mode" => "支付方式",
|
||||||
|
"order_no" => "订单号",
|
||||||
|
"trans_crrltn_no" => "交易关联流水号",
|
||||||
|
"equity_no" => "权益号",
|
||||||
|
"card_no" => "全卡号",
|
||||||
|
"sign" => "签名数据",
|
||||||
|
],
|
||||||
|
'out' => [
|
||||||
|
"msg_type" => "报文类型",
|
||||||
|
"msg_txn_code" => "交易代码",
|
||||||
|
"msg_crrltn_id" => "消息关联号",
|
||||||
|
"msg_flg" => "报文请求应答标志",
|
||||||
|
"msg_sender" => "报文发送方",
|
||||||
|
"msg_time" => "报文日期",
|
||||||
|
"msg_sys_sn" => "平台流水号",
|
||||||
|
"msg_ver" => "报文版本号",
|
||||||
|
"msg_rsp_code" => "响应码",
|
||||||
|
"msg_rsp_desc" => "响应码描述",
|
||||||
|
"orig_amt" => "原始金额",
|
||||||
|
"discount_amt" => "折扣金额",
|
||||||
|
"pay_amt" => "支付金额",
|
||||||
|
"serv_chg" => "服务费",
|
||||||
|
"commission" => "佣金",
|
||||||
|
"ad" => "广告",
|
||||||
|
"pos_receipt" => "POS优惠",
|
||||||
|
"coupon_no" => "凭证号",
|
||||||
|
"coupon_type" => "凭证类型",
|
||||||
|
"sp_biz_code" => "SP统计码",
|
||||||
|
"charge_code" => "计费码",
|
||||||
|
"pos_event_title" => "SP活动主题",
|
||||||
|
"sp_contact" => "SP联系电话",
|
||||||
|
"sp_name" => "SP名称",
|
||||||
|
"event_no" => "活动号",
|
||||||
|
"td_code" => "二维码",
|
||||||
|
"memo" => "附言",
|
||||||
|
"mkt_sp_chnl_no" => "营销渠道号",
|
||||||
|
"point_amt" => "积分抵扣金额",
|
||||||
|
"sign" => "签名数据",
|
||||||
|
],
|
||||||
|
],
|
||||||
|
//销账冲正通知接口
|
||||||
|
'002101' => [
|
||||||
|
'in' => [
|
||||||
|
"msg_type" => "报文类型",
|
||||||
|
"msg_txn_code" => "交易代码",
|
||||||
|
"msg_crrltn_id" => "消息关联号",
|
||||||
|
"msg_flg" => "报文请求应答标志",
|
||||||
|
"msg_sender" => "报文发送方",
|
||||||
|
"msg_time" => "报文日期",
|
||||||
|
"msg_sys_sn" => "平台流水号",
|
||||||
|
"msg_ver" => "报文版本号",
|
||||||
|
"shop_no" => "门店号",
|
||||||
|
"term_no" => "终端号",
|
||||||
|
"req_serial_no" => "冲正流水号",
|
||||||
|
"orig_req_serial_no" => "原始销账流水号",
|
||||||
|
"trans_crrltn_no" => "交易关联流水号",
|
||||||
|
"sign" => "签名数据",
|
||||||
|
],
|
||||||
|
'out' => [
|
||||||
|
"msg_type" => "报文类型",
|
||||||
|
"msg_txn_code" => "交易代码",
|
||||||
|
"msg_crrltn_id" => "消息关联号",
|
||||||
|
"msg_flg" => "报文请求应答标志",
|
||||||
|
"msg_sender" => "报文发送方",
|
||||||
|
"msg_time" => "报文日期",
|
||||||
|
"msg_sys_sn" => "平台流水号",
|
||||||
|
"msg_ver" => "报文版本号",
|
||||||
|
"msg_rsp_code" => "响应码",
|
||||||
|
"msg_rsp_desc" => "响应码描述",
|
||||||
|
"sign" => "签名数据",
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'002102' => [
|
||||||
|
'in' => [
|
||||||
|
"msg_type" => "报文类型",
|
||||||
|
"msg_txn_code" => "交易代码",
|
||||||
|
"msg_crrltn_id" => "消息关联号",
|
||||||
|
"msg_flg" => "报文请求应答标志",
|
||||||
|
"msg_sender" => "报文发送方",
|
||||||
|
"msg_time" => "报文日期",
|
||||||
|
"msg_sys_sn" => "平台流水号",
|
||||||
|
"msg_ver" => "报文版本号",
|
||||||
|
"shop_no" => "门店号",
|
||||||
|
"term_no" => "终端号",
|
||||||
|
"req_serial_no" => "撤销流水号",
|
||||||
|
"orig_req_serial_no" => "原始销账流水号",
|
||||||
|
"trans_crrltn_no" => "交易关联流水号",
|
||||||
|
"sign" => "签名数据",
|
||||||
|
],
|
||||||
|
'out' => [
|
||||||
|
"msg_type" => "报文类型",
|
||||||
|
"msg_txn_code" => "交易代码",
|
||||||
|
"msg_crrltn_id" => "消息关联号",
|
||||||
|
"msg_flg" => "报文请求应答标志",
|
||||||
|
"msg_sender" => "报文发送方",
|
||||||
|
"msg_time" => "报文日期",
|
||||||
|
"msg_sys_sn" => "平台流水号",
|
||||||
|
"msg_ver" => "报文版本号",
|
||||||
|
"msg_rsp_code" => "响应码",
|
||||||
|
"msg_rsp_desc" => "响应码描述",
|
||||||
|
"ad" => "广告",
|
||||||
|
"td_code" => "二维码",
|
||||||
|
"sign" => "签名数据",
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'openid' => [
|
||||||
|
'in' => [
|
||||||
|
"msg_type" => "报文类型",
|
||||||
|
"msg_txn_code" => "交易代码",
|
||||||
|
"msg_crrltn_id" => "消息关联号",
|
||||||
|
"msg_sender" => "报文发送方",
|
||||||
|
"callback_type" => "回调类型",
|
||||||
|
"callback_url" => "回调地址",
|
||||||
|
],
|
||||||
|
'out' => [
|
||||||
|
"msg_sender" => "报文类型",
|
||||||
|
"nonce_str" => "随机码",
|
||||||
|
"timestamp" => "时间戳",
|
||||||
|
"auth_scope" => "授权类型",
|
||||||
|
"callback_type" => "回调类型",
|
||||||
|
"callback_url" => "回调地址",
|
||||||
|
"sign" => "签名数据",
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'code' => [
|
||||||
|
'in' => [
|
||||||
|
"msg_type" => "报文类型",
|
||||||
|
"msg_txn_code" => "交易代码",
|
||||||
|
"msg_crrltn_id" => "消息关联号",
|
||||||
|
"msg_sender" => "报文发送方",
|
||||||
|
"issue_user_id" => "发券平台渠道用户id",//领取微信活动的券码送微信的openid
|
||||||
|
"event_no" => "活动号",
|
||||||
|
"mobile" => "手机号",
|
||||||
|
],
|
||||||
|
'out' => [
|
||||||
|
"code" => "优惠券",
|
||||||
|
"sign" => "签名数据",
|
||||||
|
],
|
||||||
|
],
|
||||||
|
//去联盟领券
|
||||||
|
'106040' => [
|
||||||
|
'in' => [
|
||||||
|
"msg_type" => "报文类型",
|
||||||
|
"msg_txn_code" => "交易代码",
|
||||||
|
"msg_crrltn_id" => "消息关联号",
|
||||||
|
"msg_flg" => "报文请求应答标志",
|
||||||
|
"msg_sender" => "报文发送方",
|
||||||
|
"msg_time" => "报文日期",
|
||||||
|
"msg_sys_sn" => "平台流水号",
|
||||||
|
"msg_ver" => "报文版本号",
|
||||||
|
"shop_no" => "门店号",
|
||||||
|
"term_no" => "终端号",
|
||||||
|
"req_serial_no" => "撤销流水号",
|
||||||
|
"orig_req_serial_no" => "原始销账流水号",
|
||||||
|
"trans_crrltn_no" => "交易关联流水号",
|
||||||
|
'sp_chnl_no' => "渠道方",
|
||||||
|
'sp_order_no' => "第三方订单号",
|
||||||
|
'order_date' => "订单日期",
|
||||||
|
'event_no' => "活动号",
|
||||||
|
'issue_user_id' => "发券平台渠道用户id",
|
||||||
|
],
|
||||||
|
'out' => [
|
||||||
|
"msg_type" => "报文类型",
|
||||||
|
"msg_txn_code" => "交易代码",
|
||||||
|
"msg_crrltn_id" => "消息关联号",
|
||||||
|
"msg_flg" => "报文请求应答标志",
|
||||||
|
"msg_sender" => "报文发送方",
|
||||||
|
"msg_time" => "报文日期",
|
||||||
|
"msg_sys_sn" => "平台流水号",
|
||||||
|
"msg_ver" => "报文版本号",
|
||||||
|
"msg_rsp_code" => "响应码",
|
||||||
|
"msg_rsp_desc" => "响应码描述",
|
||||||
|
"sign" => "签名数据",
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
//回调核销信息
|
||||||
|
'012100' => [
|
||||||
|
'in' => [
|
||||||
|
"msg_type" => "报文类型",
|
||||||
|
"msg_txn_code" => "交易代码",
|
||||||
|
"msg_crrltn_id" => "消息关联号",
|
||||||
|
"msg_flg" => "报文请求应答标志",
|
||||||
|
"msg_sender" => "报文发送方",
|
||||||
|
"msg_time" => "报文日期",
|
||||||
|
"msg_sys_sn" => "平台流水号",
|
||||||
|
"msg_ver" => "报文版本号",
|
||||||
|
"mchnt_no" => "商户号",
|
||||||
|
"term_no" => "终端号",
|
||||||
|
"shop_no" => "门店号",
|
||||||
|
"req_serial_no" => "销券流水号",
|
||||||
|
"coupon_no" => "凭证号",
|
||||||
|
"coupon_type" => "凭证类型",
|
||||||
|
"enc_card_no" => "加密卡号",
|
||||||
|
"acq_term_sn" => "受理终端流水号",
|
||||||
|
"refer_no" => "检索参考号",
|
||||||
|
"sett_date" => "清算日期",
|
||||||
|
"txn_date" => "交易日期",
|
||||||
|
"txn_time" => "交易时间",
|
||||||
|
"orig_amt" => "原始金额",
|
||||||
|
"discount_amt" => "优惠的金额",
|
||||||
|
"pay_amt" => "支付金额",
|
||||||
|
"pay_mode" => "支付方式",
|
||||||
|
"event_no" => "活动号",
|
||||||
|
"trans_crrltn_no" => "交易关联流水号",
|
||||||
|
"equity_no" => "权益号",
|
||||||
|
"order_no" => "订单号",
|
||||||
|
"point" => "使用的积分数量",
|
||||||
|
"point_amt" => "积分抵扣金额",
|
||||||
|
"point_account_no" => "积分账户号",
|
||||||
|
"mkt_uuid" => "联盟码申请流水号",
|
||||||
|
"custom_info" => "第三方自定义域",
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
];
|
||||||
@@ -3,15 +3,25 @@
|
|||||||
return [
|
return [
|
||||||
'coupon_model' => \App\Models\Coupon::class,
|
'coupon_model' => \App\Models\Coupon::class,
|
||||||
'rules' => [
|
'rules' => [
|
||||||
'ysd' => [
|
'ysd' => [
|
||||||
// 'pattern' => '/^YSD\d{12}/',
|
// 'pattern' => '/^YSD\d{12}/',
|
||||||
'pattern' => '/^YSD/',
|
'pattern' => '/^YSD/',
|
||||||
'model' => \XuanChen\Coupon\Action\YsdAction::class,
|
'model' => \XuanChen\Coupon\Action\YsdAction::class,
|
||||||
],
|
],
|
||||||
'pingan' => [
|
'unionpay' => [
|
||||||
|
// 'pattern' => '/^YSD\d{12}/',
|
||||||
|
'pattern' => '/^66406/',
|
||||||
|
'model' => \XuanChen\Coupon\Action\YsdAction::class,
|
||||||
|
],
|
||||||
|
'pingan' => [
|
||||||
'pattern' => '/^\d{12}$/',
|
'pattern' => '/^\d{12}$/',
|
||||||
'model' => \XuanChen\Coupon\Action\PinganAction::class,
|
'model' => \XuanChen\Coupon\Action\PinganAction::class,
|
||||||
],
|
],
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'froms' => [
|
||||||
|
'bsshop',//本时商城
|
||||||
|
'bslive',//本时生活
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "xuanchen/coupon",
|
|
||||||
"description": "卡券相关",
|
|
||||||
"license": "MIT",
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "玄尘",
|
|
||||||
"email": "122383162@qq.com"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"require": {
|
|
||||||
"php": ">=7.1.3",
|
|
||||||
"laravel/framework": "*"
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"psr-0": {
|
|
||||||
"XuanChen\\Coupon": "src/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"extra": {
|
|
||||||
"laravel": {
|
|
||||||
"providers": [
|
|
||||||
"XuanChen\\Coupon\\ServiceProvider"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
return [
|
|
||||||
'coupon_model' => \App\Models\Coupon::class,
|
|
||||||
'rules' => [
|
|
||||||
'pingan' => [
|
|
||||||
'pattern' => '/^\d{12}$/',
|
|
||||||
'model' => \XuanChen\Coupon\Action\PinganAction::class,
|
|
||||||
],
|
|
||||||
'ysd' => [
|
|
||||||
'pattern' => '/^YSD/',
|
|
||||||
'model' => \XuanChen\Coupon\Action\YsdAction::class,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
];
|
|
||||||
@@ -1,197 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace XuanChen\Coupon\Action;
|
|
||||||
|
|
||||||
use App\Models\Coupon;
|
|
||||||
use App\Models\Log as LogModel;
|
|
||||||
|
|
||||||
class Init
|
|
||||||
{
|
|
||||||
|
|
||||||
//渠道
|
|
||||||
public $user;
|
|
||||||
|
|
||||||
//卡券编号
|
|
||||||
public $redemptionCode;
|
|
||||||
|
|
||||||
//订单金额
|
|
||||||
public $total;
|
|
||||||
|
|
||||||
//网点编号
|
|
||||||
public $outletId;
|
|
||||||
|
|
||||||
//活动id
|
|
||||||
public $activityId;
|
|
||||||
|
|
||||||
//手机号
|
|
||||||
public $mobile;
|
|
||||||
|
|
||||||
//核销的卡券 创建的核销记录
|
|
||||||
public $coupon;
|
|
||||||
|
|
||||||
//查询返回卡券信息
|
|
||||||
public $query_coupon;
|
|
||||||
|
|
||||||
//订单id
|
|
||||||
public $orderid;
|
|
||||||
|
|
||||||
//查询到的卡券规则和商品id 只有平安券才有
|
|
||||||
public $queryData;
|
|
||||||
|
|
||||||
//设置渠道
|
|
||||||
public function setUser($user)
|
|
||||||
{
|
|
||||||
$this->user = $user;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
//设置渠道
|
|
||||||
public function setOrderId($orderid)
|
|
||||||
{
|
|
||||||
$this->orderid = $orderid;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
//设置核销码
|
|
||||||
public function setCode($redemptionCode)
|
|
||||||
{
|
|
||||||
$this->redemptionCode = $redemptionCode;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//设置订单总额
|
|
||||||
public function setTotal($total)
|
|
||||||
{
|
|
||||||
$this->total = $total;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//设置网点id
|
|
||||||
public function setOutletId($outletId)
|
|
||||||
{
|
|
||||||
$this->outletId = $outletId;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//设置活动id
|
|
||||||
public function setActivityId($activityId)
|
|
||||||
{
|
|
||||||
$this->activityId = $activityId;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//设置手机号
|
|
||||||
public function setMobile($mobile)
|
|
||||||
{
|
|
||||||
$this->mobile = $mobile;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notes: 插入日志
|
|
||||||
* @Author: 玄尘
|
|
||||||
* @Date : 2020/6/30 10:29
|
|
||||||
* @param $url
|
|
||||||
* @param $method
|
|
||||||
* @param $params
|
|
||||||
* @param string $type
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function createLog($url, $method, $params, $type = 'pingan')
|
|
||||||
{
|
|
||||||
$data = [
|
|
||||||
'path' => $url,
|
|
||||||
'method' => $method,
|
|
||||||
'type' => $type,
|
|
||||||
'in_source' => $params,
|
|
||||||
];
|
|
||||||
|
|
||||||
$info = LogModel::create($data);
|
|
||||||
|
|
||||||
return $info;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notes: 更新日志
|
|
||||||
* @Author: 玄尘
|
|
||||||
* @Date : 2020/6/30 10:29
|
|
||||||
* @param $log
|
|
||||||
* @param $params
|
|
||||||
*/
|
|
||||||
public static function updateLog($log, $params)
|
|
||||||
{
|
|
||||||
$log->out_source = $params;
|
|
||||||
$log->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
//统一门店 相同金额 3分钟之内看作是一笔订单
|
|
||||||
public function CheckCount()
|
|
||||||
{
|
|
||||||
if ($this->queryData) {
|
|
||||||
if (isset($this->queryData['thirdPartyGoodsId']) && $this->queryData['thirdPartyGoodsId'] == 'YSD-full0-0') {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->orderid) {
|
|
||||||
$check_count = Coupon::where('orderid', $this->orderid)
|
|
||||||
->where('outletId', $this->outletId)
|
|
||||||
->where('total', $this->total)
|
|
||||||
->where('status', 2)
|
|
||||||
->where('created_at', '>=', now()->subMinutes(3)->format('Y-m-d H:i:s'))
|
|
||||||
->count();
|
|
||||||
} else {
|
|
||||||
$check_count = Coupon::where('outletId', $this->outletId)
|
|
||||||
->where('total', $this->total)
|
|
||||||
->where('status', 2)
|
|
||||||
->where('created_at', '>=', now()->subMinutes(3)->format('Y-m-d H:i:s'))
|
|
||||||
->count();
|
|
||||||
}
|
|
||||||
|
|
||||||
$count = floor($this->total / 100);
|
|
||||||
|
|
||||||
if ($check_count > 0) {
|
|
||||||
// if ($this->total < 100) {
|
|
||||||
// return '核销失败,订单金额少于100只能核销一张优惠券。';
|
|
||||||
// }
|
|
||||||
if ($check_count >= $count) {
|
|
||||||
return "核销失败,此订单您只能使用 {$count} 张优惠券";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notes: 校验是否已经核销过
|
|
||||||
* @Author: 玄尘
|
|
||||||
* @Date : 2020/8/8 13:43
|
|
||||||
*/
|
|
||||||
public function HasCheck()
|
|
||||||
{
|
|
||||||
$info = Coupon::where('redemptionCode', $this->redemptionCode)
|
|
||||||
->where('outletId', $this->outletId)
|
|
||||||
->where('total', $this->total)
|
|
||||||
->where('status', 2)
|
|
||||||
->first();
|
|
||||||
if ($info) {
|
|
||||||
return '核销失败,此优惠券已被使用';
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace XuanChen\Coupon\Action;
|
|
||||||
|
|
||||||
use XuanChen\Coupon\Action\pingan\Query;
|
|
||||||
use XuanChen\Coupon\Action\pingan\Verification;
|
|
||||||
use XuanChen\Coupon\Contracts\CouponContracts;
|
|
||||||
|
|
||||||
class PinganAction extends Init implements CouponContracts
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notes: 核销执行入口
|
|
||||||
* @Author: 玄尘
|
|
||||||
* @Date : 2020/6/29 14:49
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function start()
|
|
||||||
{
|
|
||||||
return (new Verification)->setCode($this->redemptionCode)
|
|
||||||
->setUser($this->user)
|
|
||||||
->setOutletId($this->outletId)
|
|
||||||
->setTotal($this->total)
|
|
||||||
->setOrderId($this->orderid)
|
|
||||||
->start();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notes: 查询卡券详情
|
|
||||||
* @Author: 玄尘
|
|
||||||
* @Date : 2020/6/29 15:15
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function detail()
|
|
||||||
{
|
|
||||||
$info = (new Query)->setOutletId($this->outletId)
|
|
||||||
->setCode($this->redemptionCode)
|
|
||||||
->start();
|
|
||||||
|
|
||||||
return $info;
|
|
||||||
}
|
|
||||||
|
|
||||||
//发券
|
|
||||||
function grant()
|
|
||||||
{
|
|
||||||
return '没这个接口';
|
|
||||||
}
|
|
||||||
|
|
||||||
//作废
|
|
||||||
function destroy()
|
|
||||||
{
|
|
||||||
return '没这个接口';
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace XuanChen\Coupon\Action;
|
|
||||||
|
|
||||||
use XuanChen\Coupon\Action\ysd\YsdDestroy;
|
|
||||||
use XuanChen\Coupon\Action\ysd\YsdGrant;
|
|
||||||
use XuanChen\Coupon\Action\ysd\YsdQuery;
|
|
||||||
use XuanChen\Coupon\Action\ysd\YsdVerification;
|
|
||||||
use XuanChen\Coupon\Contracts\CouponContracts;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class YsdAction 自有卡券核销
|
|
||||||
* @Author : 玄尘
|
|
||||||
* @Date : 2020/7/21 9:41
|
|
||||||
* @package XuanChen\Coupon\Action
|
|
||||||
*/
|
|
||||||
class YsdAction extends Init implements CouponContracts
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notes: 发券
|
|
||||||
* @Author: 玄尘
|
|
||||||
* @Date : 2020/7/21 10:08
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function grant()
|
|
||||||
{
|
|
||||||
return (new YsdGrant)->setActivityId($this->activityId)
|
|
||||||
->setOutletId($this->outletId)
|
|
||||||
->setMobile($this->mobile)
|
|
||||||
->start();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notes: 查询卡券详情
|
|
||||||
* @Author: 玄尘
|
|
||||||
* @Date : 2020/6/29 15:15
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function detail()
|
|
||||||
{
|
|
||||||
$query_coupon = (new YsdQuery)->setOutletId($this->outletId)
|
|
||||||
->setCode($this->redemptionCode)
|
|
||||||
->start();
|
|
||||||
|
|
||||||
if (!is_string($query_coupon)) {
|
|
||||||
return [
|
|
||||||
'name' => $query_coupon->activity->title,
|
|
||||||
'code' => $query_coupon->code,
|
|
||||||
'full' => $query_coupon->full,
|
|
||||||
'price' => $query_coupon->price,
|
|
||||||
'status' => $query_coupon->status,
|
|
||||||
'used_at' => (string)$query_coupon->used_at,
|
|
||||||
'startTime' => (string)$query_coupon->start_at,
|
|
||||||
'endTime' => (string)$query_coupon->end_at,
|
|
||||||
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
return $query_coupon;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notes: 作废
|
|
||||||
* @Author: 玄尘
|
|
||||||
* @Date : 2020/7/21 11:32
|
|
||||||
*/
|
|
||||||
public function destroy()
|
|
||||||
{
|
|
||||||
return $res = (new YsdDestroy)->setCode($this->redemptionCode)
|
|
||||||
->setOutletId($this->outletId)
|
|
||||||
->start();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notes: 核销执行入口
|
|
||||||
* @Author: 玄尘
|
|
||||||
* @Date : 2020/6/29 14:49
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function start()
|
|
||||||
{
|
|
||||||
return $res = (new YsdVerification)->setCode($this->redemptionCode)
|
|
||||||
->setUser($this->user)
|
|
||||||
->setOutletId($this->outletId)
|
|
||||||
->setTotal($this->total)
|
|
||||||
->setOrderId($this->orderid)
|
|
||||||
->start();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,205 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace XuanChen\Coupon\Action\pingan;
|
|
||||||
|
|
||||||
use App\Models\PinganToken;
|
|
||||||
use GuzzleHttp\Client;
|
|
||||||
use GuzzleHttp\Exception\RequestException;
|
|
||||||
use XuanChen\Coupon\Action\Init;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 超市购物券
|
|
||||||
*/
|
|
||||||
class PingAnInit extends Init
|
|
||||||
{
|
|
||||||
|
|
||||||
protected $this_type;
|
|
||||||
|
|
||||||
protected $baseUri;
|
|
||||||
|
|
||||||
protected $tokenUri;
|
|
||||||
|
|
||||||
protected $client_id;
|
|
||||||
|
|
||||||
protected $grant_type;
|
|
||||||
|
|
||||||
protected $client_secret;
|
|
||||||
|
|
||||||
protected $access_token;
|
|
||||||
|
|
||||||
protected $userName;
|
|
||||||
|
|
||||||
protected $error;
|
|
||||||
|
|
||||||
protected $aes_code; //aes 密钥
|
|
||||||
|
|
||||||
protected $log;//日志
|
|
||||||
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
$this->this_type = config('pingan.this_type');
|
|
||||||
$pingan = config('pingan.' . $this->this_type);
|
|
||||||
|
|
||||||
$this->baseUri = $pingan['Uri'];
|
|
||||||
$this->tokenUri = $pingan['tokenUri'];
|
|
||||||
$this->client_id = $pingan['client_id'];
|
|
||||||
$this->grant_type = $pingan['grant_type'];
|
|
||||||
$this->userName = $pingan['userName'];
|
|
||||||
$this->client_secret = $pingan['client_secret'];
|
|
||||||
$this->aes_code = $pingan['AES_CODE'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取access_token
|
|
||||||
* @return void [type] [description]
|
|
||||||
*/
|
|
||||||
public function getToken()
|
|
||||||
{
|
|
||||||
//从数据库里找token
|
|
||||||
$token = PinganToken::where('type', $this->this_type)->orderBy('id', 'desc')->first();
|
|
||||||
|
|
||||||
if ($token) {
|
|
||||||
$access_token = $token->access_token;
|
|
||||||
$expires_in = $token->expires_in;
|
|
||||||
$get_token_time = $token->get_token_time;
|
|
||||||
$diffMinutes = $get_token_time->diffInMinutes(now(), false);
|
|
||||||
if ($diffMinutes < $expires_in) {
|
|
||||||
$this->access_token = $access_token;
|
|
||||||
} else {
|
|
||||||
$this->getAjaxToken();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$this->getAjaxToken();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取毫秒级别的时间戳
|
|
||||||
*/
|
|
||||||
public function getMsecTime()
|
|
||||||
{
|
|
||||||
[$msec, $sec] = explode(' ', microtime());
|
|
||||||
$msectime = (float)sprintf('%.0f', (floatval($msec) + floatval($sec)) * 1000);
|
|
||||||
$msectime = explode('.', $msectime);
|
|
||||||
|
|
||||||
return $msectime[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求平台 access_token
|
|
||||||
* @return void [type] [description]
|
|
||||||
*/
|
|
||||||
public function getAjaxToken()
|
|
||||||
{
|
|
||||||
$params = [
|
|
||||||
'client_id' => $this->client_id,
|
|
||||||
'grant_type' => $this->grant_type,
|
|
||||||
'client_secret' => $this->client_secret,
|
|
||||||
];
|
|
||||||
|
|
||||||
try {
|
|
||||||
$log = $this->createLog($this->tokenUri, 'POST', $params, 'pingan');
|
|
||||||
|
|
||||||
$client = new Client();
|
|
||||||
$response = $client->request('POST', $this->tokenUri, [
|
|
||||||
'form_params' => $params,
|
|
||||||
]);
|
|
||||||
$body = $response->getBody();
|
|
||||||
$content = $body->getContents();
|
|
||||||
$result = json_decode($content, true);
|
|
||||||
|
|
||||||
$this->updateLog($log, $result); //更新日志
|
|
||||||
|
|
||||||
if ($result['ret'] > 0) {
|
|
||||||
$this->error = $result['msg'];
|
|
||||||
} else {
|
|
||||||
$data = $result['data'];
|
|
||||||
PinganToken::create([
|
|
||||||
'type' => $this->this_type,
|
|
||||||
'access_token' => $data['access_token'],
|
|
||||||
'expires_in' => $data['expires_in'],
|
|
||||||
'get_token_time' => now(),
|
|
||||||
]);
|
|
||||||
$this->access_token = $data['access_token'];
|
|
||||||
$this->error = '';
|
|
||||||
}
|
|
||||||
} catch (RequestException $e) {
|
|
||||||
$this->error = $e->getMessage();
|
|
||||||
$this->updateLog($log, [$this->error]); //更新日志
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通用获取数据接口
|
|
||||||
* @param [type] $url 请求地址
|
|
||||||
* @param array $query 传递参数
|
|
||||||
* @param array $json 需要传的json数据
|
|
||||||
* @param string $method 方式
|
|
||||||
* @return array|mixed [type] [description]
|
|
||||||
*/
|
|
||||||
public function getPingAnData($url, $query = [], $json = [], $method = 'POST')
|
|
||||||
{
|
|
||||||
$this->getToken();
|
|
||||||
|
|
||||||
if ($this->error) {
|
|
||||||
return $this->error;
|
|
||||||
}
|
|
||||||
|
|
||||||
$postData = [
|
|
||||||
'query' => array_merge([
|
|
||||||
'access_token' => $this->access_token,
|
|
||||||
'request_id' => $this->getMsecTime(),
|
|
||||||
'userName' => $this->userName,
|
|
||||||
], $query),
|
|
||||||
'json' => $json,
|
|
||||||
'headers' => [
|
|
||||||
'Content-Type' => 'application/json;charset=utf-8',
|
|
||||||
'accept' => 'application/json;charset=utf-8',
|
|
||||||
],
|
|
||||||
];
|
|
||||||
|
|
||||||
$log = $this->createLog($url, $method, $postData, 'pingan'); //日志
|
|
||||||
|
|
||||||
try {
|
|
||||||
$client = new Client();
|
|
||||||
$response = $client->request($method, $url, $postData);
|
|
||||||
$body = $response->getBody();
|
|
||||||
$content = $body->getContents();
|
|
||||||
$result = json_decode($content, true);
|
|
||||||
|
|
||||||
if ($result['ret'] > 0) {
|
|
||||||
$retData = $result['msg'];
|
|
||||||
} else {
|
|
||||||
$retData = $result['data'];
|
|
||||||
}
|
|
||||||
$this->updateLog($log, $retData);//更新日志
|
|
||||||
|
|
||||||
return $retData;
|
|
||||||
} catch (RequestException $e) {
|
|
||||||
$this->updateLog($log, [$e->getMessage()]);//更新日志
|
|
||||||
|
|
||||||
return ['ret' => '99999', $e->getMessage()];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//加密
|
|
||||||
public function encrypt($str)
|
|
||||||
{
|
|
||||||
if (is_array($str)) {
|
|
||||||
$str = json_encode($str);
|
|
||||||
}
|
|
||||||
$data = openssl_encrypt($str, 'aes-128-ecb', $this->aes_code, OPENSSL_RAW_DATA);
|
|
||||||
|
|
||||||
return base64_encode($data);
|
|
||||||
}
|
|
||||||
|
|
||||||
//解密
|
|
||||||
public function decrypt($str)
|
|
||||||
{
|
|
||||||
$encrypted = base64_decode($str);
|
|
||||||
|
|
||||||
return openssl_decrypt($encrypted, 'aes-128-ecb', $this->aes_code, OPENSSL_RAW_DATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace XuanChen\Coupon\Action\pingan;
|
|
||||||
|
|
||||||
use App\Models\User;
|
|
||||||
|
|
||||||
class Query extends PingAnInit
|
|
||||||
{
|
|
||||||
|
|
||||||
public function start()
|
|
||||||
{
|
|
||||||
|
|
||||||
try {
|
|
||||||
//查询网点是否存在
|
|
||||||
$outlet = User::where('outlet_id', $this->outletId)->first();
|
|
||||||
|
|
||||||
if (!$outlet) {
|
|
||||||
throw new \Exception('网点编号错误,未查询到网点信息');
|
|
||||||
}
|
|
||||||
|
|
||||||
$url = $this->baseUri . 'partner/v2/coupondetail';
|
|
||||||
$params = [
|
|
||||||
'redemptionCode' => $this->redemptionCode,
|
|
||||||
'outletNo' => $outlet->PaOutletId,
|
|
||||||
'thirdOutletNo' => $outlet->outlet_id,
|
|
||||||
];
|
|
||||||
|
|
||||||
$res = $this->getPingAnData($url, $params);
|
|
||||||
|
|
||||||
if (!is_array($res)) {
|
|
||||||
throw new \Exception($res);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($res['code'] != 200) {
|
|
||||||
throw new \Exception($res['message']);
|
|
||||||
}
|
|
||||||
|
|
||||||
return collect($res['data']);
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
return $e->getMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,298 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace XuanChen\Coupon\Action\pingan;
|
|
||||||
|
|
||||||
use App\Models\Coupon;
|
|
||||||
use App\Models\User;
|
|
||||||
use Carbon\Carbon;
|
|
||||||
|
|
||||||
class Verification extends PingAnInit
|
|
||||||
{
|
|
||||||
|
|
||||||
public $ticket;
|
|
||||||
|
|
||||||
public function start()
|
|
||||||
{
|
|
||||||
//检查是否已经核销过
|
|
||||||
$res = $this->HasCheck();
|
|
||||||
if ($res !== false) {
|
|
||||||
return $res;
|
|
||||||
}
|
|
||||||
|
|
||||||
//查询卡券信息
|
|
||||||
$this->query_coupon = (new Query)->setOutletId($this->outletId)
|
|
||||||
->setCode($this->redemptionCode)
|
|
||||||
->start();
|
|
||||||
if (is_string($this->query_coupon)) {
|
|
||||||
return $this->query_coupon;
|
|
||||||
}
|
|
||||||
|
|
||||||
//校验卡券
|
|
||||||
$ticket = $this->checkCoupon();
|
|
||||||
if (!is_array($ticket)) {
|
|
||||||
return $ticket;
|
|
||||||
}
|
|
||||||
|
|
||||||
//检查可核销次数
|
|
||||||
$ret = $this->CheckCount();
|
|
||||||
if ($ret !== true) {
|
|
||||||
return $ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
//增加核销记录
|
|
||||||
$coupon = $this->AddCoupon();
|
|
||||||
if (is_string($coupon)) {
|
|
||||||
return $coupon;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
$params = [
|
|
||||||
'couponNo' => $coupon->redemptionCode,
|
|
||||||
'partnerOrderId' => date('ymdHis') . sprintf("%0" . strlen(999999) . "d", mt_rand(0, 999999)),
|
|
||||||
'outletId' => $coupon->PaOutletId,
|
|
||||||
'productId' => $coupon->productId,
|
|
||||||
'timestamp' => $this->getMsecTime(),
|
|
||||||
];
|
|
||||||
|
|
||||||
$url = $this->baseUri . 'partner/redemption';
|
|
||||||
$str = $this->encrypt($params);
|
|
||||||
$res = $this->getPingAnData($url, [], ['data' => $str]);
|
|
||||||
|
|
||||||
if (!is_array($res)) {
|
|
||||||
$coupon->remark = $res;
|
|
||||||
$coupon->status = 3;
|
|
||||||
$coupon->save();
|
|
||||||
throw new \Exception($res);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($res['code'] != 200) {
|
|
||||||
$coupon->remark = $res['code'] . '--' . $res['message'];
|
|
||||||
$coupon->status = 3;
|
|
||||||
$coupon->save();
|
|
||||||
throw new \Exception($res['message']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$data = $res['data'];
|
|
||||||
|
|
||||||
$coupon->remark = $data['message'];
|
|
||||||
$coupon->status = ($data['status'] == 1) ? 2 : 3;
|
|
||||||
$coupon->save();
|
|
||||||
|
|
||||||
//返回的数据
|
|
||||||
$resdata = [
|
|
||||||
'price' => $coupon->price,
|
|
||||||
'name' => $coupon->couponName,
|
|
||||||
'total' => $coupon->total,
|
|
||||||
];
|
|
||||||
|
|
||||||
//核销成功 执行分润
|
|
||||||
$coupon->profit();
|
|
||||||
|
|
||||||
return $resdata;
|
|
||||||
|
|
||||||
} catch (Exception $e) {
|
|
||||||
$coupon->status = 3;
|
|
||||||
$coupon->remark = '核销失败 ' . $e->getMessage();
|
|
||||||
$coupon->save();
|
|
||||||
|
|
||||||
return $coupon->remark;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notes: 如可核销记录
|
|
||||||
* @Author: 玄尘
|
|
||||||
* @Date : 2020/7/21 15:03
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function AddCoupon()
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
$couponData = [
|
|
||||||
'user_id' => $this->user->id,
|
|
||||||
'type' => Coupon::TYPE_PINGAN,
|
|
||||||
'outletId' => $this->outletId,
|
|
||||||
'orderid' => $this->orderid,
|
|
||||||
'PaOutletId' => $this->queryData['PaOutletId'],
|
|
||||||
'redemptionCode' => $this->redemptionCode,
|
|
||||||
'productId' => $this->queryData['productId'],
|
|
||||||
'thirdPartyGoodsId' => $this->queryData['thirdPartyGoodsId'],
|
|
||||||
'couponName' => $this->query_coupon['couponName'],
|
|
||||||
'price' => $this->ticket['price'],
|
|
||||||
'total' => $this->total,
|
|
||||||
'profit' => $this->ticket['profit'],
|
|
||||||
'status' => 0,
|
|
||||||
'startTime' => $this->query_coupon['startTime'],
|
|
||||||
'endTime' => $this->query_coupon['endTime'],
|
|
||||||
];
|
|
||||||
|
|
||||||
return $coupon = Coupon::create($couponData);
|
|
||||||
|
|
||||||
} catch (Exception $e) {
|
|
||||||
return $e->getMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notes: 检查卡券信息
|
|
||||||
* @Author: 玄尘
|
|
||||||
* @Date : 2020/6/29 16:40
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function checkCoupon()
|
|
||||||
{
|
|
||||||
|
|
||||||
//检查卡券是否已被核销
|
|
||||||
if ($this->query_coupon['status'] > 0) {
|
|
||||||
if (isset(config('pingan.coupon_status')[$this->query_coupon['status']])) {
|
|
||||||
return '核销失败,平安券' . config('pingan.coupon_status')[$this->query_coupon['status']];
|
|
||||||
}
|
|
||||||
|
|
||||||
return '核销失败,平安券不可用。';
|
|
||||||
}
|
|
||||||
|
|
||||||
$startTime = Carbon::parse($this->query_coupon['startTime']);
|
|
||||||
$endTime = Carbon::parse($this->query_coupon['endTime']);
|
|
||||||
$now = now();
|
|
||||||
|
|
||||||
if ($startTime->gt($now)) {
|
|
||||||
return '核销失败,平安券未开始使用。';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($now->gt($endTime)) {
|
|
||||||
return '核销失败,平安券已过期。';
|
|
||||||
}
|
|
||||||
|
|
||||||
//查找适配的商品id 和 网点id
|
|
||||||
$pinganData = $this->getPinganProduct();
|
|
||||||
|
|
||||||
if (is_string($pinganData)) {
|
|
||||||
return $pinganData;
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取相关优惠信息
|
|
||||||
return $this->checkCode();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 校验平安券编号
|
|
||||||
* @return array|string [type] [description]
|
|
||||||
*/
|
|
||||||
public function checkCode()
|
|
||||||
{
|
|
||||||
$code = $this->user->code->where('code', $this->queryData['thirdPartyGoodsId'])->first();
|
|
||||||
if (!$code) {
|
|
||||||
return "核销失败,未找到此项平安券规则,请联系管理人员检查渠道配置。";
|
|
||||||
}
|
|
||||||
|
|
||||||
$ticket = explode('-', $this->queryData['thirdPartyGoodsId']);
|
|
||||||
|
|
||||||
if (!is_array($ticket) || count($ticket) != 3) {
|
|
||||||
return "核销失败,平安券规则格式不正确。";
|
|
||||||
}
|
|
||||||
|
|
||||||
$full = $ticket[1]; //full100
|
|
||||||
$price = $ticket[2];
|
|
||||||
preg_match('/\d+/', $full, $result);
|
|
||||||
|
|
||||||
if (empty($result) || !is_array($result)) {
|
|
||||||
return "核销失败,平安券规则格式不正确。";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!is_numeric($this->total)) {
|
|
||||||
return "核销失败,订单金额必须是数字";
|
|
||||||
}
|
|
||||||
if ($result[0] > $this->total) {
|
|
||||||
return '核销失败,订单金额不足,平安券不可使用。';
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->ticket = [
|
|
||||||
'total' => $result[0],
|
|
||||||
'price' => $price,
|
|
||||||
'profit' => $code->profit,
|
|
||||||
];
|
|
||||||
|
|
||||||
return $this->ticket;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查找平安商品id
|
|
||||||
* @author 玄尘 2020-04-04
|
|
||||||
* @return array|string [type] [description]
|
|
||||||
*/
|
|
||||||
public function getPinganProduct()
|
|
||||||
{
|
|
||||||
//查询网点是否存在
|
|
||||||
$outlet = User::where('outlet_id', $this->outletId)->first();
|
|
||||||
|
|
||||||
if (!$outlet) {
|
|
||||||
return '核销失败,网点编号错误,未查询到网点信息';
|
|
||||||
}
|
|
||||||
|
|
||||||
$PaOutletId = $outlet->PaOutletId;
|
|
||||||
$outlet_id = $outlet->outlet_id;
|
|
||||||
$profitOfferItemVersion = $this->query_coupon['profitOfferItemVersion'];
|
|
||||||
|
|
||||||
if (!$PaOutletId && $profitOfferItemVersion != 1) {
|
|
||||||
return '核销失败,参数错误,渠道信息缺少平安网点id';
|
|
||||||
}
|
|
||||||
|
|
||||||
$productItemList = $this->query_coupon['productItemList'];
|
|
||||||
|
|
||||||
if (!is_array($productItemList) || !is_array($productItemList[0])) {
|
|
||||||
return '核销失败,平安券数据有误,可能是未配置网点。';
|
|
||||||
}
|
|
||||||
|
|
||||||
//循环查找
|
|
||||||
$first = '';
|
|
||||||
foreach ($productItemList as $key => $item) {
|
|
||||||
$productId = $item['productId'];
|
|
||||||
$thirdPartyGoodsId = $item['thirdPartyGoodsId'];
|
|
||||||
$outletList = $item['outletList'];
|
|
||||||
if (!is_array($outletList) || !is_array($outletList[0])) {
|
|
||||||
return '核销失败,网点信息有误!请检查平安券配置信息。';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
$outletList = collect($outletList);
|
|
||||||
//判断是新版还是旧版
|
|
||||||
if ($profitOfferItemVersion) {
|
|
||||||
//新版通过第三方查询
|
|
||||||
$first = $outletList->firstWhere('thirdOutletNo', $outlet_id);
|
|
||||||
|
|
||||||
if ($first) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
//旧版通过平安网点查询
|
|
||||||
$first = $outletList->firstWhere('outletNo', $PaOutletId);
|
|
||||||
if ($first) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$first) {
|
|
||||||
return '核销失败,未找到可用网点信息。';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$thirdPartyGoodsId) {
|
|
||||||
return '核销失败,平安券编号规则有误。';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$productId) {
|
|
||||||
return '核销失败,未查询到平安券商品id。';
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->queryData = [
|
|
||||||
'thirdPartyGoodsId' => $thirdPartyGoodsId,
|
|
||||||
'productId' => $productId,
|
|
||||||
'PaOutletId' => $first['outletNo'],
|
|
||||||
];
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace XuanChen\Coupon\Action\ysd;
|
|
||||||
|
|
||||||
use App\Events\ConponCallback;
|
|
||||||
use App\Models\ActivityCoupon;
|
|
||||||
use App\Models\User;
|
|
||||||
use XuanChen\Coupon\Action\Init;
|
|
||||||
|
|
||||||
class YsdDestroy extends Init
|
|
||||||
{
|
|
||||||
|
|
||||||
public function start()
|
|
||||||
{
|
|
||||||
if ($this->redemptionCode) {
|
|
||||||
try {
|
|
||||||
if (!$this->outletId) {
|
|
||||||
throw new \Exception('缺少网点id');
|
|
||||||
}
|
|
||||||
|
|
||||||
$info = ActivityCoupon::where('code', $this->redemptionCode)->first();
|
|
||||||
|
|
||||||
if (!$info) {
|
|
||||||
throw new \Exception('未查询到卡券信息');
|
|
||||||
}
|
|
||||||
|
|
||||||
$outlet = User::where('outlet_id', $this->outletId)->first();
|
|
||||||
|
|
||||||
if (empty($outlet)) {
|
|
||||||
return '作废失败,未查询到此网点信息。';
|
|
||||||
}
|
|
||||||
|
|
||||||
$grants = $info->activity->grants()->pluck('user_id');
|
|
||||||
if ($grants->isEmpty()) {
|
|
||||||
return '作废失败,此活动还没有配置可发券渠道,请联系相关人员进行配置。';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!in_array($outlet->parent_id, $grants->toArray())) {
|
|
||||||
return '作废失败,您没有权限作废此优惠券。';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$info->canDestroy()) {
|
|
||||||
throw new \Exception('作废失败,' . $info->status_text . '不能操作');
|
|
||||||
}
|
|
||||||
|
|
||||||
$info->status = ActivityCoupon::STATUS_CLOSE;
|
|
||||||
$info->save();
|
|
||||||
|
|
||||||
event(new ConponCallback($info));
|
|
||||||
|
|
||||||
return true;
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
return $e->getMessage();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return '未获取到券码。';
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace XuanChen\Coupon\Action\ysd;
|
|
||||||
|
|
||||||
use App\Models\Activity;
|
|
||||||
use App\Models\User;
|
|
||||||
use Carbon\Carbon;
|
|
||||||
use XuanChen\Coupon\Action\Init;
|
|
||||||
|
|
||||||
class YsdGrant extends Init
|
|
||||||
{
|
|
||||||
|
|
||||||
public function start()
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
|
|
||||||
$activity = Activity::withCount('coupons')->where('code', $this->activityId)->first();
|
|
||||||
if (!$activity) {
|
|
||||||
return '发券失败,没有找到这个活动。';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$activity->status) {
|
|
||||||
return '发券失败,活动已经关闭。';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($activity->type == Activity::TYPE_SCOPE && Carbon::now()->gt($activity->end_at)) {
|
|
||||||
return '发券失败,此活动已经结束。';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($activity->total > 0 && $activity->coupons_count >= $activity->total) {
|
|
||||||
return '发券失败,已达到可发券总数。';
|
|
||||||
}
|
|
||||||
|
|
||||||
$outlet = User::where('outlet_id', $this->outletId)->first();
|
|
||||||
if (!$outlet) {
|
|
||||||
return '发券失败,未查询到此网点信息。';
|
|
||||||
}
|
|
||||||
|
|
||||||
$grants = $activity->grants()->pluck('user_id');
|
|
||||||
if ($grants->isEmpty()) {
|
|
||||||
return '发券失败,此活动还没有配置可发券渠道,请联系相关人员进行配置。';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!in_array($outlet->parent_id, $grants->toArray())) {
|
|
||||||
return '发券失败,您没有权限发此类优惠券。';
|
|
||||||
}
|
|
||||||
|
|
||||||
$coupon = $activity->grant($this->mobile, $this->outletId);
|
|
||||||
|
|
||||||
if (!is_string($coupon)) {
|
|
||||||
return [
|
|
||||||
'name' => $activity->title,
|
|
||||||
'code' => $coupon->code,
|
|
||||||
'full' => $coupon->full,
|
|
||||||
'price' => $coupon->price,
|
|
||||||
'startTime' => $coupon->start_at->format('Y-m-d H:i:s'),
|
|
||||||
'endTime' => $coupon->end_at->format('Y-m-d H:i:s'),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
return $coupon;
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
return $e->getMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace XuanChen\Coupon\Action\ysd;
|
|
||||||
|
|
||||||
use App\Models\ActivityCoupon;
|
|
||||||
use App\Models\User;
|
|
||||||
use XuanChen\Coupon\Action\Init;
|
|
||||||
|
|
||||||
class YsdQuery extends Init
|
|
||||||
{
|
|
||||||
|
|
||||||
public function start()
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
$info = User::where('outlet_id', $this->outletId)->first();
|
|
||||||
|
|
||||||
if (!$info) {
|
|
||||||
throw new \Exception('网点编号错误,未查询到网点信息');
|
|
||||||
}
|
|
||||||
|
|
||||||
$coupon = ActivityCoupon::where('code', $this->redemptionCode)->first();
|
|
||||||
|
|
||||||
if (!$coupon) {
|
|
||||||
throw new \Exception('卡券编号错误,未查询到卡券信息');
|
|
||||||
}
|
|
||||||
|
|
||||||
$activity = $coupon->activity;
|
|
||||||
if (!$activity) {
|
|
||||||
throw new \Exception('操作失败,未查到活动信息');
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取所有可核销渠道
|
|
||||||
$verifications = $activity->verifications()->pluck('user_id');
|
|
||||||
|
|
||||||
if ($verifications->isEmpty()) {
|
|
||||||
throw new \Exception('操作失败,此活动还没有配置可核券渠道,请联系相关人员进行配置。');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!in_array($info->parent_id, $verifications->toArray())) {
|
|
||||||
throw new \Exception('操作失败,您没有权限查询此卡券信息。');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $coupon;
|
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
return $e->getMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,195 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace XuanChen\Coupon\Action\ysd;
|
|
||||||
|
|
||||||
use App\Events\ConponCallback;
|
|
||||||
use App\Models\ActivityCoupon;
|
|
||||||
use App\Models\Coupon;
|
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
use XuanChen\Coupon\Action\Init;
|
|
||||||
|
|
||||||
class YsdVerification extends Init
|
|
||||||
{
|
|
||||||
|
|
||||||
public $ticket;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notes: 核销具体流程
|
|
||||||
* @Author: 玄尘
|
|
||||||
* @Date : 2020/7/29 13:12
|
|
||||||
* @return array|string
|
|
||||||
*/
|
|
||||||
public function start()
|
|
||||||
{
|
|
||||||
//检查是否已经核销过
|
|
||||||
$res = $this->HasCheck();
|
|
||||||
if ($res !== false) {
|
|
||||||
return $res;
|
|
||||||
}
|
|
||||||
|
|
||||||
//查询卡券信息 返回model 返回string 说明报错
|
|
||||||
$this->query_coupon = (new YsdQuery)->setOutletId($this->outletId)
|
|
||||||
->setCode($this->redemptionCode)
|
|
||||||
->start();
|
|
||||||
|
|
||||||
if (is_string($this->query_coupon)) {
|
|
||||||
return $this->query_coupon;
|
|
||||||
}
|
|
||||||
|
|
||||||
//检查可核销次数,100元为1次。
|
|
||||||
if ($this->query_coupon->activity && $this->query_coupon->activity->need_check) {
|
|
||||||
$ret = $this->CheckCount();
|
|
||||||
if ($ret !== true) {
|
|
||||||
return $ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//校验卡券
|
|
||||||
$ticket = $this->checkCoupon();
|
|
||||||
if (!is_array($ticket)) {
|
|
||||||
return $ticket;
|
|
||||||
}
|
|
||||||
|
|
||||||
//增加核销记录
|
|
||||||
$coupon = $this->AddCoupon();
|
|
||||||
if (is_string($coupon)) {
|
|
||||||
return $coupon;
|
|
||||||
}
|
|
||||||
|
|
||||||
DB::beginTransaction();
|
|
||||||
|
|
||||||
try {
|
|
||||||
$this->query_coupon->status = ActivityCoupon::STATUS_USED;
|
|
||||||
$this->query_coupon->used_at = now();
|
|
||||||
$this->query_coupon->save();
|
|
||||||
|
|
||||||
$this->coupon->status = 2;
|
|
||||||
$this->coupon->remark = '核销成功';
|
|
||||||
$this->coupon->save();
|
|
||||||
//返回的数据
|
|
||||||
$resdata = [
|
|
||||||
'name' => $this->coupon->couponName,
|
|
||||||
'total' => $this->coupon->total,
|
|
||||||
'price' => $this->coupon->price,
|
|
||||||
];
|
|
||||||
//核销成功 执行分润
|
|
||||||
$this->coupon->profit();
|
|
||||||
DB::commit();
|
|
||||||
|
|
||||||
event(new ConponCallback($this->query_coupon));
|
|
||||||
|
|
||||||
return $resdata;
|
|
||||||
} catch (Exception $e) {
|
|
||||||
DB::rollback();
|
|
||||||
|
|
||||||
$this->coupon->status = 3;
|
|
||||||
$this->coupon->remark = '核销失败 ' . $e->getMessage();
|
|
||||||
$this->coupon->save();
|
|
||||||
|
|
||||||
return $this->coupon->remark;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notes: 检查卡券信息
|
|
||||||
* @Author: 玄尘
|
|
||||||
* @Date : 2020/6/29 16:40
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function checkCoupon()
|
|
||||||
{
|
|
||||||
|
|
||||||
if (!$this->query_coupon->canRedemption()) {
|
|
||||||
return '核销失败,优惠券不可核销';
|
|
||||||
}
|
|
||||||
|
|
||||||
$now = now();
|
|
||||||
|
|
||||||
if ($this->query_coupon->start_at->gt($now)) {
|
|
||||||
return '核销失败,卡券未到可用时间。请在' . $this->query_coupon->start_at->format('Y-m-d H:i:s') . '后使用';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($now->gt($this->query_coupon->end_at)) {
|
|
||||||
return '核销失败,卡券已过期。';
|
|
||||||
}
|
|
||||||
|
|
||||||
$rule_code = $this->query_coupon->activity->rule->code;
|
|
||||||
$code = $this->user->code->where('code', $rule_code)->first();
|
|
||||||
|
|
||||||
if (!$code) {
|
|
||||||
return "核销失败,您没有权限使用此卡券优惠活动。";
|
|
||||||
}
|
|
||||||
|
|
||||||
$ticket = explode('-', $rule_code);
|
|
||||||
if (!is_array($ticket) || count($ticket) != 3) {
|
|
||||||
return "核销失败,卡券规则格式不正确";
|
|
||||||
}
|
|
||||||
|
|
||||||
$full = $ticket[1]; //full100
|
|
||||||
$price = $ticket[2];
|
|
||||||
// preg_match('/(\d{3}(\.\d+)?)/is', $full, $match);
|
|
||||||
preg_match('/\d+/', $full, $match);
|
|
||||||
|
|
||||||
if (!is_array($match)) {
|
|
||||||
return "核销失败,卡券规则格式不正确。";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!is_numeric($this->total)) {
|
|
||||||
return "核销失败,订单金额必须是数字";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($match[0] > $this->total) {
|
|
||||||
return '核销失败,订单金额不足。';
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->ticket = [
|
|
||||||
'total' => $match[0],
|
|
||||||
'price' => $price,
|
|
||||||
'profit' => $code->profit,
|
|
||||||
];
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notes: 如可核销记录
|
|
||||||
* @Author: 玄尘
|
|
||||||
* @Date : 2020/7/21 15:03
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function AddCoupon()
|
|
||||||
{
|
|
||||||
DB::beginTransaction();
|
|
||||||
|
|
||||||
try {
|
|
||||||
$couponData = [
|
|
||||||
'user_id' => $this->user->id,
|
|
||||||
'type' => Coupon::TYPE_YSD,
|
|
||||||
'outletId' => $this->outletId,
|
|
||||||
'orderid' => $this->orderid,
|
|
||||||
'PaOutletId' => '',
|
|
||||||
'redemptionCode' => $this->redemptionCode,
|
|
||||||
'thirdPartyGoodsId' => $this->query_coupon->activity->rule->code,
|
|
||||||
'couponName' => $this->query_coupon->activity->title,
|
|
||||||
'price' => $this->ticket['price'],
|
|
||||||
'total' => $this->total,
|
|
||||||
'profit' => $this->ticket['profit'],
|
|
||||||
'status' => $this->query_coupon->status,
|
|
||||||
'startTime' => $this->query_coupon->start_at,
|
|
||||||
'endTime' => $this->query_coupon->end_at,
|
|
||||||
];
|
|
||||||
|
|
||||||
$this->coupon = Coupon::create($couponData);
|
|
||||||
|
|
||||||
DB::commit();
|
|
||||||
|
|
||||||
return $this->coupon;
|
|
||||||
} catch (Exception $e) {
|
|
||||||
DB::rollback();
|
|
||||||
|
|
||||||
return $e->getMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace XuanChen\Coupon\Contracts;
|
|
||||||
|
|
||||||
interface CheckCouponContracts
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* start
|
|
||||||
* @return [type] [description]
|
|
||||||
*/
|
|
||||||
function start();
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace XuanChen\Coupon\Contracts;
|
|
||||||
|
|
||||||
interface CouponContracts
|
|
||||||
{
|
|
||||||
|
|
||||||
//发券接口
|
|
||||||
function grant();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notes: 查询卡券详情
|
|
||||||
* @Author: 玄尘
|
|
||||||
* @Date : 2020/6/29 15:15
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
function detail();
|
|
||||||
|
|
||||||
//作废接口
|
|
||||||
function destroy();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notes: 核销执行入口
|
|
||||||
* @Author: 玄尘
|
|
||||||
* @Date : 2020/6/29 14:49
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
function start();
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,144 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace XuanChen\Coupon;
|
|
||||||
|
|
||||||
use App\Models\Activity;
|
|
||||||
use App\Models\User;
|
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 自有卡券系统
|
|
||||||
*/
|
|
||||||
class Coupon
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notes: 发券接口
|
|
||||||
* @Author: 玄尘
|
|
||||||
* @Date : 2020/6/28 15:07
|
|
||||||
* @param $activityId 活动编号
|
|
||||||
* @param $outletId 网点编号
|
|
||||||
* @param $mobile 手机号
|
|
||||||
*/
|
|
||||||
public static function Grant($activityId, $outletId, $mobile)
|
|
||||||
{
|
|
||||||
$model = config('xuanchen_coupon.rules.ysd.model');
|
|
||||||
|
|
||||||
return (new $model)->setActivityId($activityId)
|
|
||||||
->setOutletId($outletId)
|
|
||||||
->setMobile($mobile)
|
|
||||||
->grant();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notes: 查询接口
|
|
||||||
* @Author: 玄尘
|
|
||||||
* @Date : 2020/7/21 11:58
|
|
||||||
* @param $redemptionCode
|
|
||||||
*/
|
|
||||||
public static function Query($redemptionCode, $outletId)
|
|
||||||
{
|
|
||||||
if (!$redemptionCode) {
|
|
||||||
return '查询失败,未获取到券码';
|
|
||||||
}
|
|
||||||
|
|
||||||
$model = self::getModelByCode($redemptionCode);
|
|
||||||
if (is_string($model)) {
|
|
||||||
return $model;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $model->setCode($redemptionCode)
|
|
||||||
->setOutletId($outletId)
|
|
||||||
->detail();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notes: 卡券作废
|
|
||||||
* @Author: 玄尘
|
|
||||||
* @Date : 2020/9/2 16:54
|
|
||||||
* @param $redemptionCode
|
|
||||||
* @param $outletId
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public static function Destroy($redemptionCode, $outletId)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
$model = self::getModelByCode($redemptionCode);
|
|
||||||
if (is_string($model)) {
|
|
||||||
return $model;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $model->setCode($redemptionCode)
|
|
||||||
->setOutletId($outletId)
|
|
||||||
->destroy();
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
return $e->getMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notes: 根据券码 获取class
|
|
||||||
* @Author: 玄尘
|
|
||||||
* @Date : 2020/7/21 12:00
|
|
||||||
* @param $code
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public static function getModelByCode($code)
|
|
||||||
{
|
|
||||||
$rules = config('xuanchen_coupon.rules');
|
|
||||||
if (!$rules) {
|
|
||||||
return '系统出错,未找到配置文件';
|
|
||||||
}
|
|
||||||
|
|
||||||
$model = '';
|
|
||||||
foreach ($rules as $rule) {
|
|
||||||
if (preg_match($rule['pattern'], $code, $matches)) {
|
|
||||||
$model = $rule['model'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$model) {
|
|
||||||
throw new \Exception('卡券核销失败。未查到卡券所属');
|
|
||||||
}
|
|
||||||
|
|
||||||
return new $model;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notes: description
|
|
||||||
* @Author: 玄尘
|
|
||||||
* @Date : 2020/8/21 13:33
|
|
||||||
* @param \App\Models\User $user 渠道
|
|
||||||
* @param string $redemptionCode 要核销的券码
|
|
||||||
* @param float $total 订单金额
|
|
||||||
* @param string $outletId 网点id
|
|
||||||
* @param string $orderid 订单id
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public static function Redemption(User $user, string $redemptionCode, float $total, string $outletId, string $orderid = '')
|
|
||||||
{
|
|
||||||
|
|
||||||
try {
|
|
||||||
$model = self::getModelByCode($redemptionCode);
|
|
||||||
if (is_string($model)) {
|
|
||||||
return $model;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $model->setUser($user)
|
|
||||||
->setCode($redemptionCode)
|
|
||||||
->setTotal($total)
|
|
||||||
->setOutletId($outletId)
|
|
||||||
->setOrderId($orderid)
|
|
||||||
->start();
|
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
return $e->getMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace XuanChen\Coupon;
|
|
||||||
|
|
||||||
use Illuminate\Support\ServiceProvider;
|
|
||||||
|
|
||||||
class CouponServiceProvider extends ServiceProvider
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Register services.
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function register()
|
|
||||||
{
|
|
||||||
dd(1);
|
|
||||||
if ($this->app->runningInConsole()) {
|
|
||||||
$this->publishes([__DIR__ . '/../config/xuanchen_coupon.php' => config_path('xuanchen_coupon.php')]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Bootstrap services.
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function boot()
|
|
||||||
{
|
|
||||||
$this->mergeConfigFrom(__DIR__ . '/../config/xuanchen_coupon.php', 'xuanchen_coupon');
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace XuanChen\Coupon;
|
|
||||||
|
|
||||||
use Illuminate\Support\ServiceProvider as LaravelServiceProvider;
|
|
||||||
|
|
||||||
class ServiceProvider extends LaravelServiceProvider
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Register services.
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function register()
|
|
||||||
{
|
|
||||||
if ($this->app->runningInConsole()) {
|
|
||||||
$this->publishes([__DIR__ . '/../config/xuanchen_coupon.php' => config_path('xuanchen_coupon.php')]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Bootstrap services.
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function boot()
|
|
||||||
{
|
|
||||||
$this->mergeConfigFrom(__DIR__ . '/../config/xuanchen_coupon.php', 'xuanchen_coupon');
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace XuanChen\Coupon\Traits;
|
|
||||||
|
|
||||||
use App\Models\Log as LogModel;
|
|
||||||
|
|
||||||
trait Log
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notes: 插入日志
|
|
||||||
* @Author: 玄尘
|
|
||||||
* @Date : 2020/6/30 10:29
|
|
||||||
* @param $url
|
|
||||||
* @param $method
|
|
||||||
* @param $params
|
|
||||||
* @param string $type
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function createLog($url, $method, $params, $type = 'pingan')
|
|
||||||
{
|
|
||||||
$data = [
|
|
||||||
'path' => $url,
|
|
||||||
'method' => $method,
|
|
||||||
'type' => $type,
|
|
||||||
'in_source' => $params,
|
|
||||||
];
|
|
||||||
|
|
||||||
$info = LogModel::create($data);
|
|
||||||
|
|
||||||
return $info;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notes: 更新日志
|
|
||||||
* @Author: 玄尘
|
|
||||||
* @Date : 2020/6/30 10:29
|
|
||||||
* @param $log
|
|
||||||
* @param $params
|
|
||||||
*/
|
|
||||||
public static function updateLog($log, $params)
|
|
||||||
{
|
|
||||||
$log->out_source = $params;
|
|
||||||
$log->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace XuanChen\Coupon\Traits;
|
|
||||||
|
|
||||||
trait SetParams
|
|
||||||
{
|
|
||||||
|
|
||||||
//渠道
|
|
||||||
public $user;
|
|
||||||
|
|
||||||
//卡券编号
|
|
||||||
public $redemptionCode;
|
|
||||||
|
|
||||||
//订单金额
|
|
||||||
public $total;
|
|
||||||
|
|
||||||
//网点编号
|
|
||||||
public $outletId;
|
|
||||||
|
|
||||||
//活动id
|
|
||||||
public $activityId;
|
|
||||||
|
|
||||||
//手机号
|
|
||||||
public $mobile;
|
|
||||||
|
|
||||||
//设置渠道
|
|
||||||
public function setUser($user)
|
|
||||||
{
|
|
||||||
$this->user = $user;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
//设置核销码
|
|
||||||
public function setCode($redemptionCode)
|
|
||||||
{
|
|
||||||
$this->redemptionCode = $redemptionCode;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//设置订单总额
|
|
||||||
public function setTotal($total)
|
|
||||||
{
|
|
||||||
$this->total = $total;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//设置网点id
|
|
||||||
public function setOutletId($outletId)
|
|
||||||
{
|
|
||||||
$this->outletId = $outletId;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//设置活动id
|
|
||||||
public function setActivityId($activityId)
|
|
||||||
{
|
|
||||||
$this->activityId = $activityId;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//设置手机号
|
|
||||||
public function setMobile($mobile)
|
|
||||||
{
|
|
||||||
$this->mobile = $mobile;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -6,6 +6,7 @@ Route::get('/test/grant', 'TestController@grant')->name('test.grant');
|
|||||||
Route::get('/test/checkcoupon', 'TestController@checkcoupon')->name('test.checkcoupon');
|
Route::get('/test/checkcoupon', 'TestController@checkcoupon')->name('test.checkcoupon');
|
||||||
Route::get('/test/query', 'TestController@query')->name('test.query');
|
Route::get('/test/query', 'TestController@query')->name('test.query');
|
||||||
Route::get('/test/destroy', 'TestController@destroy')->name('test.destroy');
|
Route::get('/test/destroy', 'TestController@destroy')->name('test.destroy');
|
||||||
|
Route::get('/test/getsign', 'TestController@getSign')->name('test.getsign');
|
||||||
|
|
||||||
Route::get('/skyxu', 'SkyxuController@index')->name('skyxu');
|
Route::get('/skyxu', 'SkyxuController@index')->name('skyxu');
|
||||||
Route::get('/coupon', 'CouponController@index')->name('coupon');
|
Route::get('/coupon', 'CouponController@index')->name('coupon');
|
||||||
|
|||||||
6
storage/cert/unionpay/dev/union/public_rsa.pem
Normal file
6
storage/cert/unionpay/dev/union/public_rsa.pem
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
-----BEGIN PUBLIC KEY-----
|
||||||
|
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDGBzj/rgW4kCZhzIxy29qp3mqY
|
||||||
|
9pV18hGK6v132RmJ9DYxGdzIwhCdlPvcSIczBcZ+OnQuqYeVVatXO7lc1MUgDPaA
|
||||||
|
FGgSQFwTTz+JwoPrn+x1ATs1jDgYucEFVzfNJagR44unFLIhZ1IP5Nn289wp3u6p
|
||||||
|
9ZtYOlmtQmwI4dHcPwIDAQAB
|
||||||
|
-----END PUBLIC KEY-----
|
||||||
17
storage/cert/unionpay/dev/ysd/private_rsa.pem
Normal file
17
storage/cert/unionpay/dev/ysd/private_rsa.pem
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
|
MIICwgIBAAKBlwr/0635gQVIE29ImQJuAs46csIvIp1AbPUAqwth+LKMRV1d5A7z
|
||||||
|
ipyO7uKfExt3Xdo94jx2j57Q1n9QubAkmJ2Wk+G2VVkf+OYgFc8rCo1URArt1Atu
|
||||||
|
QnWdGA3k0Ij2aHxI2d3LA8Ue7/WLWWqnas/FVJkcnTPtC2rSv4JO4nCMVdsXkZdj
|
||||||
|
ghKc8OTdiO6ue/QhrBlY/5cCAwEAAQKBlwQf9kEa/UB+zBMClabsnI68KocZ6BAy
|
||||||
|
temXS42kOwCyS9z8tebJfCTEEV/ZKfA17nNGm83y5F85kAcEve4Je1Y1vtV5bD5V
|
||||||
|
GCEszR57eYiRaEuYvi58zzDS6BZJwCEvj0eLNydhRBUP1gCex9IVwgjfN684TRMM
|
||||||
|
PgFOlBbQHBF1rnlff0TwcDcTvRexvhn5U65s/vM9vqkCTAN1T7Tpw5gpLQyM0hpK
|
||||||
|
S8a24mudenNS6biPUcbSlAqWeP2Ol0Zi9taX+8KUmAAoCnYIGa/PjrfB9tcUCilX
|
||||||
|
reugrOKdp0CLn3/mrIUCTAMuPDb0V2CEvZYH43saNRrm0xMh3V4xEFX6EXHDX9cI
|
||||||
|
VGGUvJfxisjh76+Zn+4SculBSSCMcnwSFxMvYoAeeuzVbatOB6Zhts8KlGsCTANi
|
||||||
|
Lucp5FYmy03BJfvU/0jgPK3f+SOGVuhdSTyHYZLuYFhsv7N9NlcFgqyBaCqXAo0z
|
||||||
|
JbavE8rUeuc6UyrZ/29P2Hcsmqx7L0YbcmUCTAI6ELZ5A+Pzi7jK9R1vD9cx3H38
|
||||||
|
q7wSpdlMJ4J6w1MN5eYb+J544i4a4XEUIcDQ8dsVdllve4gaMkWgW1pP/Mhr9UiG
|
||||||
|
bRy0NQVn5tkCTAFK+hDf5ViHZZncGmiFArUNPRZMhfdg1rqpUzs/yEKc06flZY67
|
||||||
|
irE8EaiGRWfmwMqLGqfrW/bzMOWG1O5z9qf1Dg0ViimoUKNHEog=
|
||||||
|
-----END RSA PRIVATE KEY-----
|
||||||
6
storage/cert/unionpay/dev/ysd/public_rsa.pem
Normal file
6
storage/cert/unionpay/dev/ysd/public_rsa.pem
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
-----BEGIN PUBLIC KEY-----
|
||||||
|
MIG1MA0GCSqGSIb3DQEBAQUAA4GjADCBnwKBlwr/0635gQVIE29ImQJuAs46csIv
|
||||||
|
Ip1AbPUAqwth+LKMRV1d5A7zipyO7uKfExt3Xdo94jx2j57Q1n9QubAkmJ2Wk+G2
|
||||||
|
VVkf+OYgFc8rCo1URArt1AtuQnWdGA3k0Ij2aHxI2d3LA8Ue7/WLWWqnas/FVJkc
|
||||||
|
nTPtC2rSv4JO4nCMVdsXkZdjghKc8OTdiO6ue/QhrBlY/5cCAwEAAQ==
|
||||||
|
-----END PUBLIC KEY-----
|
||||||
6
storage/cert/unionpay/test/union/public_rsa.pem
Normal file
6
storage/cert/unionpay/test/union/public_rsa.pem
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
-----BEGIN PUBLIC KEY-----
|
||||||
|
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDqWyL8fkpHtCS0hN60Y8kchp/B
|
||||||
|
S4r6aXyu9VE9fW/z/JKL50V+dP1bZ7Dl0eJqWN+mEYMQ9D5DVA89fpqYXI3jc8Dl
|
||||||
|
yeKsjXOWpLV+a+MnmhPxO3IMP3+i+orSzJHF6kWHxgivloJVl7bq8xah2u/5BjUP
|
||||||
|
nBju+BlZK478uwU2rwIDAQAB
|
||||||
|
-----END PUBLIC KEY-----
|
||||||
15
storage/cert/unionpay/test/ysd/private_rsa.pem
Normal file
15
storage/cert/unionpay/test/ysd/private_rsa.pem
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
|
MIICXAIBAAKBgQCbCoYOxjVu15ONuotlIBxiyMQP+Ch8TavHHVTDrY54mRPLq0dR
|
||||||
|
Xrlpj+Ziu8PY8kHfPdNbRlftVQUgnhfOP/2j2QbnTDAF4tUZ0B9YjvCgLMpGMOAZ
|
||||||
|
tuw+u+VwVILegUUO3Yh/T6nZ4kcMw5vj/N4vGdHcABV+BK7639+Xep1OlQIDAQAB
|
||||||
|
AoGAR1Z5RpUHAwBoYV9DQn2a8g0kwaBSqJdogc7KMNtL4cu1oxIlV5h5Qcw3mpiA
|
||||||
|
zfLyQlEFTks4q/hhypdTptAk2SblXh0yc7TU1xD984j+ZfWB7r+Nu0OyaWIBPih5
|
||||||
|
Mn7DynQ5q7dnwff5nmYqi49xUPVTKAGJKiYTkKyA5UwauEECQQDK+fw5Ybf96LvH
|
||||||
|
WsvspUJ/YhQMhcZ6PLINLeHuEJwxoygnDNK2UbBPFFb5ZjIh5PHh8EtkPANZY0uH
|
||||||
|
voP4gC8lAkEAw4reMtlMiJQlRmsMguahWQXIo6PPwclSqXK/aYzqjkPrwWQZdXa/
|
||||||
|
LcCd77D0qLvkDEUM2Kh9NsNayd3F+37+sQJAb0Lgs0ORa6krZXer2Kgt701/1+1s
|
||||||
|
gozKvNatxaVtOPhKhj1NM4tLrc1kb4lJabLptAPYD7Wl0FXRjTMtfAYn0QJAVmMO
|
||||||
|
QRag6iHQyehXEamEFIkql6iyCyG/BB8ukxnvMcSt7bUkTjGUykizPYZGwBip6gXD
|
||||||
|
ZCAjmUL64/23DqGPMQJBAIUUShpi307GBmC0AXyvkt36tPYvDMykF4qHivScbZF+
|
||||||
|
UJ2e5Y0lvR/+5bEgFcLk7phW5XxofcFWxO7BSbu2bGk=
|
||||||
|
-----END RSA PRIVATE KEY-----
|
||||||
6
storage/cert/unionpay/test/ysd/public_rsa.pem
Normal file
6
storage/cert/unionpay/test/ysd/public_rsa.pem
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
-----BEGIN PUBLIC KEY-----
|
||||||
|
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCbCoYOxjVu15ONuotlIBxiyMQP
|
||||||
|
+Ch8TavHHVTDrY54mRPLq0dRXrlpj+Ziu8PY8kHfPdNbRlftVQUgnhfOP/2j2Qbn
|
||||||
|
TDAF4tUZ0B9YjvCgLMpGMOAZtuw+u+VwVILegUUO3Yh/T6nZ4kcMw5vj/N4vGdHc
|
||||||
|
ABV+BK7639+Xep1OlQIDAQAB
|
||||||
|
-----END PUBLIC KEY-----
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
<div class="box grid-box">
|
|
||||||
<?php if(isset($title)): ?>
|
|
||||||
<div class="box-header with-border">
|
|
||||||
<h3 class="box-title"> <?php echo e($title, false); ?></h3>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php if( $grid->showTools() || $grid->showExportBtn() || $grid->showCreateBtn() ): ?>
|
|
||||||
<div class="box-header with-border">
|
|
||||||
<div class="pull-right">
|
|
||||||
<?php echo $grid->renderColumnSelector(); ?>
|
|
||||||
|
|
||||||
<?php echo $grid->renderExportButton(); ?>
|
|
||||||
|
|
||||||
<?php echo $grid->renderCreateButton(); ?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<?php if( $grid->showTools() ): ?>
|
|
||||||
<div class="pull-left">
|
|
||||||
<?php echo $grid->renderHeaderTools(); ?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php echo $grid->renderFilter(); ?>
|
|
||||||
|
|
||||||
|
|
||||||
<?php echo $grid->renderHeader(); ?>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- /.box-header -->
|
|
||||||
<div class="box-body table-responsive no-padding">
|
|
||||||
<table class="table table-hover grid-table" id="<?php echo e($grid->tableID, false); ?>">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<?php $__currentLoopData = $grid->visibleColumns(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $column): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<th <?php echo $column->formatHtmlAttributes(); ?>><?php echo $column->getLabel(); ?><?php echo $column->renderHeader(); ?></th>
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<?php if($grid->hasQuickCreate()): ?>
|
|
||||||
<?php echo $grid->renderQuickCreate(); ?>
|
|
||||||
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
<?php if($grid->rows()->isEmpty() && $grid->showDefineEmptyPage()): ?>
|
|
||||||
<?php echo $__env->make('admin::grid.empty-grid', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php $__currentLoopData = $grid->rows(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<tr <?php echo $row->getRowAttributes(); ?>>
|
|
||||||
<?php $__currentLoopData = $grid->visibleColumnNames(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $name): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<td <?php echo $row->getColumnAttributes($name); ?>>
|
|
||||||
<?php echo $row->column($name); ?>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
</tr>
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
</tbody>
|
|
||||||
|
|
||||||
<?php echo $grid->renderTotalRow(); ?>
|
|
||||||
|
|
||||||
|
|
||||||
</table>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php echo $grid->renderFooter(); ?>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="box-footer clearfix">
|
|
||||||
<?php echo $grid->paginator(); ?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<!-- /.box-body -->
|
|
||||||
</div>
|
|
||||||
<?php /**PATH /home/wwwroot/pingan/vendor/encore/laravel-admin/src/../resources/views/grid/table.blade.php ENDPATH**/ ?>
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
<form <?php echo $attributes; ?>>
|
|
||||||
<div class="box-body fields-group">
|
|
||||||
|
|
||||||
<?php $__currentLoopData = $fields; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $field): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<?php echo $field->render(); ?>
|
|
||||||
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php if($method != 'GET'): ?>
|
|
||||||
<input type="hidden" name="_token" value="<?php echo e(csrf_token(), false); ?>">
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<!-- /.box-body -->
|
|
||||||
<?php if(count($buttons) > 0): ?>
|
|
||||||
<div class="box-footer">
|
|
||||||
<div class="col-md-<?php echo e($width['label'], false); ?>"></div>
|
|
||||||
|
|
||||||
<div class="col-md-<?php echo e($width['field'], false); ?>">
|
|
||||||
<?php if(in_array('reset', $buttons)): ?>
|
|
||||||
<div class="btn-group pull-left">
|
|
||||||
<button type="reset" class="btn btn-warning pull-right"><?php echo e(trans('admin.reset'), false); ?></button>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php if(in_array('submit', $buttons)): ?>
|
|
||||||
<div class="btn-group pull-right">
|
|
||||||
<button type="submit" class="btn btn-info pull-right"><?php echo e(trans('admin.submit'), false); ?></button>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
</form>
|
|
||||||
<?php /**PATH /home/wwwroot/pingan/vendor/encore/laravel-admin/src/../resources/views/widgets/form.blade.php ENDPATH**/ ?>
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
<div class="<?php echo e($viewClass['form-group'], false); ?> <?php echo ($errors->has($errorKey['start'].'start') || $errors->has($errorKey['end'].'end')) ? 'has-error' : ''; ?>">
|
|
||||||
|
|
||||||
<label for="<?php echo e($id['start'], false); ?>" class="<?php echo e($viewClass['label'], false); ?> control-label"><?php echo e($label, false); ?></label>
|
|
||||||
|
|
||||||
<div class="<?php echo e($viewClass['field'], false); ?>">
|
|
||||||
|
|
||||||
<?php echo $__env->make('admin::form.error', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
|
||||||
|
|
||||||
<div class="row" style="width: 370px">
|
|
||||||
<div class="col-lg-6">
|
|
||||||
<div class="input-group">
|
|
||||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
|
||||||
<input type="text" name="<?php echo e($name['start'], false); ?>" value="<?php echo e(old($column['start'], $value['start'] ?? null), false); ?>" class="form-control <?php echo e($class['start'], false); ?>" style="width: 150px" <?php echo $attributes; ?> />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-lg-6">
|
|
||||||
<div class="input-group">
|
|
||||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
|
||||||
<input type="text" name="<?php echo e($name['end'], false); ?>" value="<?php echo e(old($column['end'], $value['end'] ?? null), false); ?>" class="form-control <?php echo e($class['end'], false); ?>" style="width: 150px" <?php echo $attributes; ?> />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php echo $__env->make('admin::form.help-block', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php /**PATH /home/wwwroot/pingan/vendor/encore/laravel-admin/src/../resources/views/form/daterange.blade.php ENDPATH**/ ?>
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
<!-- Main Header -->
|
|
||||||
<header class="main-header">
|
|
||||||
|
|
||||||
<!-- Logo -->
|
|
||||||
<a href="<?php echo e(admin_url('/'), false); ?>" class="logo">
|
|
||||||
<!-- mini logo for sidebar mini 50x50 pixels -->
|
|
||||||
<span class="logo-mini"><?php echo config('admin.logo-mini', config('admin.name')); ?></span>
|
|
||||||
<!-- logo for regular state and mobile devices -->
|
|
||||||
<span class="logo-lg"><?php echo config('admin.logo', config('admin.name')); ?></span>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<!-- Header Navbar -->
|
|
||||||
<nav class="navbar navbar-static-top" role="navigation">
|
|
||||||
<!-- Sidebar toggle button-->
|
|
||||||
<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
|
|
||||||
<span class="sr-only">Toggle navigation</span>
|
|
||||||
</a>
|
|
||||||
<ul class="nav navbar-nav hidden-sm visible-lg-block">
|
|
||||||
<?php echo Admin::getNavbar()->render('left'); ?>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<!-- Navbar Right Menu -->
|
|
||||||
<div class="navbar-custom-menu">
|
|
||||||
<ul class="nav navbar-nav">
|
|
||||||
|
|
||||||
<?php echo Admin::getNavbar()->render(); ?>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- User Account Menu -->
|
|
||||||
<li class="dropdown user user-menu">
|
|
||||||
<!-- Menu Toggle Button -->
|
|
||||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
|
||||||
<!-- The user image in the navbar-->
|
|
||||||
<img src="<?php echo e(Admin::user()->avatar, false); ?>" class="user-image" alt="User Image">
|
|
||||||
<!-- hidden-xs hides the username on small devices so only the image appears. -->
|
|
||||||
<span class="hidden-xs"><?php echo e(Admin::user()->name, false); ?></span>
|
|
||||||
</a>
|
|
||||||
<ul class="dropdown-menu">
|
|
||||||
<!-- The user image in the menu -->
|
|
||||||
<li class="user-header">
|
|
||||||
<img src="<?php echo e(Admin::user()->avatar, false); ?>" class="img-circle" alt="User Image">
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<?php echo e(Admin::user()->name, false); ?>
|
|
||||||
|
|
||||||
<small>Member since admin <?php echo e(Admin::user()->created_at, false); ?></small>
|
|
||||||
</p>
|
|
||||||
</li>
|
|
||||||
<li class="user-footer">
|
|
||||||
<div class="pull-left">
|
|
||||||
<a href="<?php echo e(admin_url('auth/setting'), false); ?>" class="btn btn-default btn-flat"><?php echo e(trans('admin.setting'), false); ?></a>
|
|
||||||
</div>
|
|
||||||
<div class="pull-right">
|
|
||||||
<a href="<?php echo e(admin_url('auth/logout'), false); ?>" class="btn btn-default btn-flat"><?php echo e(trans('admin.logout'), false); ?></a>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<!-- Control Sidebar Toggle Button -->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
</header><?php /**PATH /home/wwwroot/pingan/vendor/encore/laravel-admin/src/../resources/views/partials/header.blade.php ENDPATH**/ ?>
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
<div class="<?php echo e($viewClass['form-group'], false); ?> <?php echo !$errors->has($errorKey) ? '' : 'has-error'; ?>">
|
|
||||||
|
|
||||||
<label for="<?php echo e($id, false); ?>" class="<?php echo e($viewClass['label'], false); ?> control-label"><?php echo e($label, false); ?></label>
|
|
||||||
|
|
||||||
<div class="<?php echo e($viewClass['field'], false); ?>">
|
|
||||||
|
|
||||||
<?php echo $__env->make('admin::form.error', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
|
||||||
|
|
||||||
<textarea name="<?php echo e($name, false); ?>" class="form-control <?php echo e($class, false); ?>" rows="<?php echo e($rows, false); ?>" placeholder="<?php echo e($placeholder, false); ?>" <?php echo $attributes; ?> ><?php echo e(old($column, $value), false); ?></textarea>
|
|
||||||
|
|
||||||
<?php echo $__env->make('admin::form.help-block', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php /**PATH /home/wwwroot/pingan/vendor/encore/laravel-admin/src/../resources/views/form/textarea.blade.php ENDPATH**/ ?>
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
|
|
||||||
<meta http-equiv="Pragma" content="no-cache" />
|
|
||||||
<meta http-equiv="Expires" content="0" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
||||||
|
|
||||||
<title><?php echo $__env->yieldContent('title', $app_title??config('app.name')); ?></title>
|
|
||||||
<link rel="stylesheet" href="<?php echo e(asset('css/mzui.min.css'), false); ?>">
|
|
||||||
<link rel="stylesheet" href="<?php echo e(asset('css/swiper.min.css'), false); ?>">
|
|
||||||
<link rel="stylesheet" href="<?php echo e(asset('css/style.css'), false); ?>?_<?php echo e(time(), false); ?>">
|
|
||||||
<?php echo $__env->yieldContent('css'); ?>
|
|
||||||
<?php echo $__env->yieldContent('js'); ?>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<?php echo $__env->yieldContent('footer'); ?>
|
|
||||||
<?php echo $__env->yieldContent('pop'); ?>
|
|
||||||
<?php echo $__env->yieldContent('content'); ?>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="/js/jquery-3.2.1.min.js"></script>
|
|
||||||
<script type="text/javascript" src="/js/mzui.min.js" ></script>
|
|
||||||
<script type="text/javascript" src="/js/layer/layer.min.js" ></script>
|
|
||||||
<script type="text/javascript" src="/js/cjango.js?v=<?php echo e(uniqid(), false); ?>"></script>
|
|
||||||
|
|
||||||
<?php echo $__env->yieldContent('script'); ?>
|
|
||||||
</html>
|
|
||||||
<?php /**PATH /home/wwwroot/pingan/resources/views/layouts/app.blade.php ENDPATH**/ ?>
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
<div class="<?php echo e($viewClass['form-group'], false); ?> <?php echo !$errors->has($errorKey) ? '' : 'has-error'; ?>">
|
|
||||||
|
|
||||||
<label for="<?php echo e($id, false); ?>" class="<?php echo e($viewClass['label'], false); ?> control-label"><?php echo e($label, false); ?></label>
|
|
||||||
|
|
||||||
<div class="<?php echo e($viewClass['field'], false); ?>">
|
|
||||||
|
|
||||||
<?php echo $__env->make('admin::form.error', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
|
||||||
|
|
||||||
<input type="hidden" name="<?php echo e($name, false); ?>"/>
|
|
||||||
|
|
||||||
<select class="form-control <?php echo e($class, false); ?>" style="width: 100%;" name="<?php echo e($name, false); ?>" <?php echo $attributes; ?> >
|
|
||||||
<?php if($groups): ?>
|
|
||||||
<?php $__currentLoopData = $groups; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $group): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<optgroup label="<?php echo e($group['label'], false); ?>">
|
|
||||||
<?php $__currentLoopData = $group['options']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $select => $option): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<option value="<?php echo e($select, false); ?>" <?php echo e($select == old($column, $value) ?'selected':'', false); ?>><?php echo e($option, false); ?></option>
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
</optgroup>
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<?php else: ?>
|
|
||||||
<option value=""></option>
|
|
||||||
<?php $__currentLoopData = $options; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $select => $option): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<option value="<?php echo e($select, false); ?>" <?php echo e($select == old($column, $value) ?'selected':'', false); ?>><?php echo e($option, false); ?></option>
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<?php echo $__env->make('admin::form.help-block', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php /**PATH /home/wwwroot/pingan/vendor/encore/laravel-admin/src/../resources/views/form/select.blade.php ENDPATH**/ ?>
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
<?php $__currentLoopData = $html; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<?php echo $item; ?>
|
|
||||||
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<?php /**PATH /home/wwwroot/pingan/vendor/encore/laravel-admin/src/../resources/views/partials/html.blade.php ENDPATH**/ ?>
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
<div class="form-group">
|
|
||||||
<label><?php echo e($label, false); ?></label>
|
|
||||||
<input style="width: 100%" <?php echo $attributes; ?> />
|
|
||||||
<?php echo $__env->make('admin::actions.form.help-block', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
|
||||||
</div><?php /**PATH /home/wwwroot/pingan/vendor/encore/laravel-admin/src/../resources/views/actions/form/date.blade.php ENDPATH**/ ?>
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
<div class="box box-info">
|
|
||||||
<div class="box-header with-border">
|
|
||||||
<h3 class="box-title"><?php echo e($form->title(), false); ?></h3>
|
|
||||||
|
|
||||||
<div class="box-tools">
|
|
||||||
<?php echo $form->renderTools(); ?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- /.box-header -->
|
|
||||||
<!-- form start -->
|
|
||||||
<?php echo $form->open(); ?>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="box-body">
|
|
||||||
|
|
||||||
<?php if(!$tabObj->isEmpty()): ?>
|
|
||||||
<?php echo $__env->make('admin::form.tab', compact('tabObj'), \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
|
||||||
<?php else: ?>
|
|
||||||
<div class="fields-group">
|
|
||||||
|
|
||||||
<?php if($form->hasRows()): ?>
|
|
||||||
<?php $__currentLoopData = $form->getRows(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<?php echo $row->render(); ?>
|
|
||||||
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<?php else: ?>
|
|
||||||
<?php $__currentLoopData = $layout->columns(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $column): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<div class="col-md-<?php echo e($column->width(), false); ?>">
|
|
||||||
<?php $__currentLoopData = $column->fields(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $field): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<?php echo $field->render(); ?>
|
|
||||||
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
</div>
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<!-- /.box-body -->
|
|
||||||
|
|
||||||
<?php echo $form->renderFooter(); ?>
|
|
||||||
|
|
||||||
|
|
||||||
<?php $__currentLoopData = $form->getHiddenFields(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $field): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<?php echo $field->render(); ?>
|
|
||||||
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
|
|
||||||
<!-- /.box-footer -->
|
|
||||||
<?php echo $form->close(); ?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php /**PATH /home/wwwroot/pingan/vendor/encore/laravel-admin/src/../resources/views/form.blade.php ENDPATH**/ ?>
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
<div <?php echo $attributes; ?>>
|
|
||||||
<div class="inner">
|
|
||||||
<h3><?php echo e($info, false); ?></h3>
|
|
||||||
|
|
||||||
<p><?php echo e($name, false); ?></p>
|
|
||||||
</div>
|
|
||||||
<div class="icon">
|
|
||||||
<i class="fa fa-<?php echo e($icon, false); ?>"></i>
|
|
||||||
</div>
|
|
||||||
<a href="<?php echo e($link, false); ?>" class="small-box-footer">
|
|
||||||
<?php echo e(trans('admin.more'), false); ?>
|
|
||||||
<i class="fa fa-arrow-circle-right"></i>
|
|
||||||
</a>
|
|
||||||
</div><?php /**PATH /home/wwwroot/pingan/vendor/encore/laravel-admin/src/../resources/views/widgets/info-box.blade.php ENDPATH**/ ?>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<style type="text/css">
|
|
||||||
<?php $__currentLoopData = $style; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $s): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<?php echo $s; ?>
|
|
||||||
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
</style><?php /**PATH /home/wwwroot/pingan/vendor/encore/laravel-admin/src/../resources/views/partials/style.blade.php ENDPATH**/ ?>
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="<?php echo e($viewClass['label'], false); ?>"><h4 class="pull-right"><?php echo e($label, false); ?></h4></div>
|
|
||||||
<div class="<?php echo e($viewClass['field'], false); ?>"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr style="margin-top: 0px;">
|
|
||||||
|
|
||||||
<div id="has-many-<?php echo e($column, false); ?>" class="has-many-<?php echo e($column, false); ?>">
|
|
||||||
|
|
||||||
<div class="has-many-<?php echo e($column, false); ?>-forms">
|
|
||||||
|
|
||||||
<?php $__currentLoopData = $forms; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $pk => $form): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
|
|
||||||
<div class="has-many-<?php echo e($column, false); ?>-form fields-group">
|
|
||||||
|
|
||||||
<?php $__currentLoopData = $form->fields(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $field): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<?php echo $field->render(); ?>
|
|
||||||
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
|
|
||||||
<?php if($options['allowDelete']): ?>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="<?php echo e($viewClass['label'], false); ?> control-label"></label>
|
|
||||||
<div class="<?php echo e($viewClass['field'], false); ?>">
|
|
||||||
<div class="remove btn btn-warning btn-sm pull-right"><i class="fa fa-trash"> </i><?php echo e(trans('admin.remove'), false); ?></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
<hr>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<template class="<?php echo e($column, false); ?>-tpl">
|
|
||||||
<div class="has-many-<?php echo e($column, false); ?>-form fields-group">
|
|
||||||
|
|
||||||
<?php echo $template; ?>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="<?php echo e($viewClass['label'], false); ?> control-label"></label>
|
|
||||||
<div class="<?php echo e($viewClass['field'], false); ?>">
|
|
||||||
<div class="remove btn btn-warning btn-sm pull-right"><i class="fa fa-trash"></i> <?php echo e(trans('admin.remove'), false); ?></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<hr>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<?php if($options['allowCreate']): ?>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="<?php echo e($viewClass['label'], false); ?> control-label"></label>
|
|
||||||
<div class="<?php echo e($viewClass['field'], false); ?>">
|
|
||||||
<div class="add btn btn-success btn-sm"><i class="fa fa-save"></i> <?php echo e(trans('admin.new'), false); ?></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
</div><?php /**PATH /home/wwwroot/pingan/vendor/encore/laravel-admin/src/../resources/views/form/hasmany.blade.php ENDPATH**/ ?>
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
<div class="<?php echo e($viewClass['form-group'], false); ?> <?php echo !$errors->has($errorKey) ? '' : 'has-error'; ?>">
|
|
||||||
|
|
||||||
<label for="<?php echo e($id, false); ?>" class="<?php echo e($viewClass['label'], false); ?> control-label"><?php echo e($label, false); ?></label>
|
|
||||||
|
|
||||||
<div class="<?php echo e($viewClass['field'], false); ?>">
|
|
||||||
|
|
||||||
<?php echo $__env->make('admin::form.error', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
|
||||||
|
|
||||||
<select class="form-control <?php echo e($class, false); ?>" style="width: 100%;" name="<?php echo e($name, false); ?>[]" multiple="multiple" data-placeholder="<?php echo e($placeholder, false); ?>" <?php echo $attributes; ?> >
|
|
||||||
<?php $__currentLoopData = $options; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $select => $option): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<option value="<?php echo e($select, false); ?>" <?php echo e(in_array($select, (array)old($column, $value)) ?'selected':'', false); ?>><?php echo e($option, false); ?></option>
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
</select>
|
|
||||||
<input type="hidden" name="<?php echo e($name, false); ?>[]" />
|
|
||||||
|
|
||||||
<?php echo $__env->make('admin::form.help-block', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php /**PATH /home/wwwroot/pingan/vendor/encore/laravel-admin/src/../resources/views/form/listbox.blade.php ENDPATH**/ ?>
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
<?php if(Admin::user()->visible(\Illuminate\Support\Arr::get($item, 'roles', [])) && Admin::user()->can(\Illuminate\Support\Arr::get($item, 'permission'))): ?>
|
|
||||||
<?php if(!isset($item['children'])): ?>
|
|
||||||
<li>
|
|
||||||
<?php if(url()->isValidUrl($item['uri'])): ?>
|
|
||||||
<a href="<?php echo e($item['uri'], false); ?>" target="_blank">
|
|
||||||
<?php else: ?>
|
|
||||||
<a href="<?php echo e(admin_url($item['uri']), false); ?>">
|
|
||||||
<?php endif; ?>
|
|
||||||
<i class="fa <?php echo e($item['icon'], false); ?>"></i>
|
|
||||||
<?php if(Lang::has($titleTranslation = 'admin.menu_titles.' . trim(str_replace(' ', '_', strtolower($item['title']))))): ?>
|
|
||||||
<span><?php echo e(__($titleTranslation), false); ?></span>
|
|
||||||
<?php else: ?>
|
|
||||||
<span><?php echo e(admin_trans($item['title']), false); ?></span>
|
|
||||||
<?php endif; ?>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<?php else: ?>
|
|
||||||
<li class="treeview">
|
|
||||||
<a href="#">
|
|
||||||
<i class="fa <?php echo e($item['icon'], false); ?>"></i>
|
|
||||||
<?php if(Lang::has($titleTranslation = 'admin.menu_titles.' . trim(str_replace(' ', '_', strtolower($item['title']))))): ?>
|
|
||||||
<span><?php echo e(__($titleTranslation), false); ?></span>
|
|
||||||
<?php else: ?>
|
|
||||||
<span><?php echo e(admin_trans($item['title']), false); ?></span>
|
|
||||||
<?php endif; ?>
|
|
||||||
<i class="fa fa-angle-left pull-right"></i>
|
|
||||||
</a>
|
|
||||||
<ul class="treeview-menu">
|
|
||||||
<?php $__currentLoopData = $item['children']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<?php echo $__env->make('admin::partials.menu', $item, \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php endif; ?><?php /**PATH /home/wwwroot/pingan/vendor/encore/laravel-admin/src/../resources/views/partials/menu.blade.php ENDPATH**/ ?>
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
<div class="form-group">
|
|
||||||
<label><?php echo e($label, false); ?></label>
|
|
||||||
|
|
||||||
<select class="form-control <?php echo e($class, false); ?>" style="width: 100%;" name="<?php echo e($name, false); ?>" <?php echo $attributes; ?> >
|
|
||||||
|
|
||||||
<option value=""></option>
|
|
||||||
<?php $__currentLoopData = $options; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $select => $option): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<option value="<?php echo e($select, false); ?>" <?php echo e($select == old($column, $value) ?'selected':'', false); ?>><?php echo e($option, false); ?></option>
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
</select>
|
|
||||||
<?php echo $__env->make('admin::actions.form.help-block', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php /**PATH /home/wwwroot/pingan/vendor/encore/laravel-admin/src/../resources/views/actions/form/select.blade.php ENDPATH**/ ?>
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
<?php if(is_array($errorKey)): ?>
|
|
||||||
<?php $__currentLoopData = $errorKey; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $col): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<?php if($errors->has($col.$key)): ?>
|
|
||||||
<?php $__currentLoopData = $errors->get($col.$key); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $message): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> <?php echo e($message, false); ?></label><br/>
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<?php else: ?>
|
|
||||||
<?php if($errors->has($errorKey)): ?>
|
|
||||||
<?php $__currentLoopData = $errors->get($errorKey); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $message): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> <?php echo e($message, false); ?></label><br/>
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php endif; ?><?php /**PATH /home/wwwroot/pingan/vendor/encore/laravel-admin/src/../resources/views/form/error.blade.php ENDPATH**/ ?>
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
<div class="<?php echo e($viewClass['form-group'], false); ?> <?php echo !$errors->has($errorKey) ? '' : 'has-error'; ?>">
|
|
||||||
|
|
||||||
<label for="<?php echo e($id, false); ?>" class="<?php echo e($viewClass['label'], false); ?> control-label"><?php echo e($label, false); ?></label>
|
|
||||||
|
|
||||||
<div class="<?php echo e($viewClass['field'], false); ?>">
|
|
||||||
|
|
||||||
<?php echo $__env->make('admin::form.error', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
|
||||||
|
|
||||||
<div class="btn-group radio-group-toggle">
|
|
||||||
<?php $__currentLoopData = $options; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $option => $label): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<label class="btn btn-default <?php echo e(($option == old($column, $value)) || ($value === null && in_array($label, $checked)) ?'active':'', false); ?>">
|
|
||||||
<input type="radio" name="<?php echo e($name, false); ?>" value="<?php echo e($option, false); ?>" class="hide minimal <?php echo e($class, false); ?>" <?php echo e(($option == old($column, $value)) || ($value === null && in_array($label, $checked)) ?'checked':'', false); ?> <?php echo $attributes; ?> /> <?php echo e($label, false); ?>
|
|
||||||
</label>
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php echo $__env->make('admin::form.help-block', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php /**PATH /home/wwwroot/pingan/vendor/encore/laravel-admin/src/../resources/views/form/radiobutton.blade.php ENDPATH**/ ?>
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
<?php $__env->startSection('content'); ?>
|
|
||||||
<section class="content-header">
|
|
||||||
<h1>
|
|
||||||
<?php echo $header ?: trans('admin.title'); ?>
|
|
||||||
|
|
||||||
<small><?php echo $description ?: trans('admin.description'); ?></small>
|
|
||||||
</h1>
|
|
||||||
|
|
||||||
<!-- breadcrumb start -->
|
|
||||||
<?php if($breadcrumb): ?>
|
|
||||||
<ol class="breadcrumb" style="margin-right: 30px;">
|
|
||||||
<li><a href="<?php echo e(admin_url('/'), false); ?>"><i class="fa fa-dashboard"></i> <?php echo e(__('Home'), false); ?></a></li>
|
|
||||||
<?php $__currentLoopData = $breadcrumb; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<?php if($loop->last): ?>
|
|
||||||
<li class="active">
|
|
||||||
<?php if(\Illuminate\Support\Arr::has($item, 'icon')): ?>
|
|
||||||
<i class="fa fa-<?php echo e($item['icon'], false); ?>"></i>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php echo e($item['text'], false); ?>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<?php else: ?>
|
|
||||||
<li>
|
|
||||||
<?php if(\Illuminate\Support\Arr::has($item, 'url')): ?>
|
|
||||||
<a href="<?php echo e(admin_url(\Illuminate\Support\Arr::get($item, 'url')), false); ?>">
|
|
||||||
<?php if(\Illuminate\Support\Arr::has($item, 'icon')): ?>
|
|
||||||
<i class="fa fa-<?php echo e($item['icon'], false); ?>"></i>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php echo e($item['text'], false); ?>
|
|
||||||
|
|
||||||
</a>
|
|
||||||
<?php else: ?>
|
|
||||||
<?php if(\Illuminate\Support\Arr::has($item, 'icon')): ?>
|
|
||||||
<i class="fa fa-<?php echo e($item['icon'], false); ?>"></i>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php echo e($item['text'], false); ?>
|
|
||||||
|
|
||||||
<?php endif; ?>
|
|
||||||
</li>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
</ol>
|
|
||||||
<?php elseif(config('admin.enable_default_breadcrumb')): ?>
|
|
||||||
<ol class="breadcrumb" style="margin-right: 30px;">
|
|
||||||
<li><a href="<?php echo e(admin_url('/'), false); ?>"><i class="fa fa-dashboard"></i> <?php echo e(__('Home'), false); ?></a></li>
|
|
||||||
<?php for($i = 2; $i <= count(Request::segments()); $i++): ?>
|
|
||||||
<li>
|
|
||||||
<?php echo e(ucfirst(Request::segment($i)), false); ?>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<?php endfor; ?>
|
|
||||||
</ol>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<!-- breadcrumb end -->
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="content">
|
|
||||||
|
|
||||||
<?php echo $__env->make('admin::partials.alerts', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
|
||||||
<?php echo $__env->make('admin::partials.exception', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
|
||||||
<?php echo $__env->make('admin::partials.toastr', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
|
||||||
|
|
||||||
<?php if($_view_): ?>
|
|
||||||
<?php echo $__env->make($_view_['view'], $_view_['data'], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
|
||||||
<?php else: ?>
|
|
||||||
<?php echo $_content_; ?>
|
|
||||||
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
<?php $__env->stopSection(); ?>
|
|
||||||
|
|
||||||
<?php echo $__env->make('admin::index', ['header' => strip_tags($header)], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/wwwroot/pingan/vendor/encore/laravel-admin/src/../resources/views/content.blade.php ENDPATH**/ ?>
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
<div class="form-group">
|
|
||||||
<label><?php echo e($label, false); ?></label>
|
|
||||||
<input <?php echo $attributes; ?>>
|
|
||||||
<?php echo $__env->make('admin::actions.form.help-block', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
|
||||||
</div><?php /**PATH /home/wwwroot/pingan/vendor/encore/laravel-admin/src/../resources/views/actions/form/text.blade.php ENDPATH**/ ?>
|
|
||||||
@@ -1,139 +0,0 @@
|
|||||||
<?php $__env->startSection('title', '核销列表'); ?>
|
|
||||||
|
|
||||||
<?php $__env->startSection('css'); ?>
|
|
||||||
<link rel="stylesheet" href="<?php echo e(asset('assets/merchant/css/plugins/datapicker/datepicker3.css'), false); ?>" />
|
|
||||||
<?php $__env->stopSection(); ?>
|
|
||||||
|
|
||||||
<?php $__env->startPush('script'); ?>
|
|
||||||
<script type="text/javascript" src="<?php echo e(asset('assets/merchant/js/plugins/datapicker/bootstrap-datepicker.js'), false); ?>"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
$("#time-interval .input-daterange").datepicker({
|
|
||||||
keyboardNavigation: !1,
|
|
||||||
forceParse: !1,
|
|
||||||
autoclose: !0,
|
|
||||||
clearBtn: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
$("button").click(function(){
|
|
||||||
var $this = $(this);
|
|
||||||
var $form = $this.parents('form');
|
|
||||||
$("input[name='action']").val($this.data('action'));
|
|
||||||
$form.submit();
|
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
|
||||||
<?php $__env->stopPush(); ?>
|
|
||||||
|
|
||||||
<?php $__env->startSection('content'); ?>
|
|
||||||
<div class="ibox">
|
|
||||||
<div class="ibox-content">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-12 m-b">
|
|
||||||
<form action="<?php echo e(route('merchant.coupons'), false); ?>" class="form-inline pull-right" method="get" accept-charset="utf-8">
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="form-group">
|
|
||||||
<input type="text" placeholder="网点名称" name="outlet" class="input-sm form-control" value="<?php echo e(Request::input('outlet'), false); ?>">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<input type="text" placeholder="平安券编号" name="redemptionCode" class="input-sm form-control" value="<?php echo e(Request::input('redemptionCode'), false); ?>">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<select class="form-control m-b" name="status">
|
|
||||||
<option value="">状态</option>
|
|
||||||
<option value="2" <?php if(request()->status==2): ?> selected="" <?php endif; ?> >核销成功</option>
|
|
||||||
<option value="3" <?php if(request()->status==3): ?> selected="" <?php endif; ?> >核销失败</option>
|
|
||||||
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<select class="form-control m-b" name="thirdPartyGoodsId">
|
|
||||||
<option value="">政策</option>
|
|
||||||
<option value="YSD-full100-10" <?php if(request()->thirdPartyGoodsId=='YSD-full100-10'): ?> selected="" <?php endif; ?> >100减10元</option>
|
|
||||||
<option value="YSD-full100-25" <?php if(request()->thirdPartyGoodsId=='YSD-full100-25'): ?> selected="" <?php endif; ?> >100减25元</option>
|
|
||||||
<option value="YSD-full100-50" <?php if(request()->thirdPartyGoodsId=='YSD-full100-50'): ?> selected="" <?php endif; ?> >100减50元</option>
|
|
||||||
<option value="YSD-full200-100" <?php if(request()->thirdPartyGoodsId=='YSD-full200-100'): ?> selected="" <?php endif; ?> >200减100元</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group" id="time-interval">
|
|
||||||
<div class="input-daterange input-group">
|
|
||||||
<input type="text" class="input-sm form-control" placeholder="核销时间" readonly name="start" value="<?php echo e(Request::input('start'), false); ?>" />
|
|
||||||
<span class="input-group-addon">~</span>
|
|
||||||
<input type="text" class="input-sm form-control" placeholder="核销时间" readonly name="end" value="<?php echo e(Request::input('end'), false); ?>" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<span class="input-group-btn">
|
|
||||||
<input type="hidden" name="action" value="search">
|
|
||||||
<button type="button" class="btn btn-sm btn-primary" data-action="search" ><i class="fa fa-check"></i> 搜索</button>
|
|
||||||
<button type="button" class="btn btn-sm btn-warning confirm" tip='确认要导出当前条件内容?' data-action="excel"><i class="fa fa-paste"></i> 导出</button>
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<span class="input-group-btn">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="table-responsive">
|
|
||||||
<table class="table table-hover">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th width="100">ID</th>
|
|
||||||
<th>网点名称</th>
|
|
||||||
|
|
||||||
<th>平安券编号</th>
|
|
||||||
<th>优惠政策</th>
|
|
||||||
<th>核销金额</th>
|
|
||||||
<th>状态</th>
|
|
||||||
<th>处理结果</th>
|
|
||||||
<th>核销时间</th>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php $__currentLoopData = $coupons; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $coupon): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<tr>
|
|
||||||
<td> <?php echo e($coupon->id, false); ?> </td>
|
|
||||||
<td><?php echo e($coupon->outlet ? $coupon->outlet->nickname : 'Id:' . $coupon->outletId, false); ?></td>
|
|
||||||
|
|
||||||
<td><?php echo e($coupon->redemptionCode, false); ?></td>
|
|
||||||
<td><?php echo e($coupon->couponName, false); ?></td>
|
|
||||||
<td><?php echo e($coupon->price, false); ?></td>
|
|
||||||
<td><?php echo e($coupon->status_text, false); ?></td>
|
|
||||||
<td><?php echo e($coupon->remark, false); ?></td>
|
|
||||||
<td><?php echo e($coupon->created_at, false); ?></td>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<span class="badge badge-primary">全部:<?php echo e($data['all'], false); ?>张 </span>
|
|
||||||
<span class="badge badge-success">成功:<?php echo e($data['pass'], false); ?>张 </span>
|
|
||||||
<span class="badge badge-error">失败:<?php echo e($data['reject'], false); ?>张 </span>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="text-right">
|
|
||||||
<?php echo e($coupons->appends([
|
|
||||||
'outlet'=>Request::input('outlet'),
|
|
||||||
'status'=>Request::input('status'),
|
|
||||||
'redemptionCode'=>Request::input('redemptionCode'),
|
|
||||||
'start'=>Request::input('start'),
|
|
||||||
'end'=>Request::input('end'),
|
|
||||||
])->links('Merchant::common.pagination'), false); ?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php $__env->stopSection(); ?>
|
|
||||||
|
|
||||||
<?php echo $__env->make('Merchant::layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/wwwroot/pingan/app/Merchant/Resources/views/coupon/index.blade.php ENDPATH**/ ?>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<div class="form-group">
|
|
||||||
<label><?php echo e($label, false); ?></label>
|
|
||||||
<input type="file" class="<?php echo e($class, false); ?>" name="<?php echo e($name, false); ?>" <?php echo $attributes; ?> />
|
|
||||||
<?php echo $__env->make('admin::actions.form.help-block', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
|
||||||
</div>
|
|
||||||
<?php /**PATH /home/wwwroot/pingan/vendor/encore/laravel-admin/src/../resources/views/actions/form/file.blade.php ENDPATH**/ ?>
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
<li class="dd-item" data-id="<?php echo e($branch[$keyName], false); ?>">
|
|
||||||
<div class="dd-handle">
|
|
||||||
<?php echo $branchCallback($branch); ?>
|
|
||||||
|
|
||||||
<span class="pull-right dd-nodrag">
|
|
||||||
<a href="<?php echo e(url("$path/$branch[$keyName]/edit"), false); ?>"><i class="fa fa-edit"></i></a>
|
|
||||||
<a href="javascript:void(0);" data-id="<?php echo e($branch[$keyName], false); ?>" class="tree_branch_delete"><i class="fa fa-trash"></i></a>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<?php if(isset($branch['children'])): ?>
|
|
||||||
<ol class="dd-list">
|
|
||||||
<?php $__currentLoopData = $branch['children']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $branch): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<?php echo $__env->make($branchView, $branch, \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
</ol>
|
|
||||||
<?php endif; ?>
|
|
||||||
</li><?php /**PATH /home/wwwroot/pingan/vendor/encore/laravel-admin/src/../resources/views/tree/branch.blade.php ENDPATH**/ ?>
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
<?php $__env->startSection('title', 'dashboard - index'); ?>
|
|
||||||
|
|
||||||
<?php $__env->startSection('content'); ?>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-4">
|
|
||||||
<div class="ibox float-e-margins">
|
|
||||||
<div class="ibox-title">
|
|
||||||
<h5>商户信息</h5>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="ibox-content">
|
|
||||||
<p><i class="fa "></i> 登录账户:<?php echo e($user->username, false); ?></p>
|
|
||||||
<p><i class="fa "></i> 用户昵称:<?php echo e($user->nickname, false); ?></p>
|
|
||||||
<p><i class="fa "></i> 用户身份:<?php echo e($user->identity_text, false); ?></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php $__env->stopSection(); ?>
|
|
||||||
|
|
||||||
<?php echo $__env->make('Merchant::layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/wwwroot/pingan/app/Merchant/Resources/views/index/dashboard.blade.php ENDPATH**/ ?>
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
<div class="box-header with-border <?php echo e($expand?'':'hide', false); ?> filter-box" id="<?php echo e($filterID, false); ?>">
|
|
||||||
<form action="<?php echo $action; ?>" class="form-horizontal" pjax-container method="get">
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<?php $__currentLoopData = $layout->columns(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $column): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<div class="col-md-<?php echo e($column->width(), false); ?>">
|
|
||||||
<div class="box-body">
|
|
||||||
<div class="fields-group">
|
|
||||||
<?php $__currentLoopData = $column->filters(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $filter): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<?php echo $filter->render(); ?>
|
|
||||||
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
</div>
|
|
||||||
<!-- /.box-body -->
|
|
||||||
|
|
||||||
<div class="box-footer">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-<?php echo e($layout->columns()->first()->width(), false); ?>">
|
|
||||||
<div class="col-md-2"></div>
|
|
||||||
<div class="col-md-8">
|
|
||||||
<div class="btn-group pull-left">
|
|
||||||
<button class="btn btn-info submit btn-sm"><i
|
|
||||||
class="fa fa-search"></i> <?php echo e(trans('admin.search'), false); ?></button>
|
|
||||||
</div>
|
|
||||||
<div class="btn-group pull-left " style="margin-left: 10px;">
|
|
||||||
<a href="<?php echo $action; ?>" class="btn btn-default btn-sm"><i
|
|
||||||
class="fa fa-undo"></i> <?php echo e(trans('admin.reset'), false); ?></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<?php /**PATH /home/wwwroot/pingan/vendor/encore/laravel-admin/src/../resources/views/filter/container.blade.php ENDPATH**/ ?>
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
<div class="<?php echo e($viewClass['form-group'], false); ?> <?php echo !$errors->has($column) ?: 'has-error'; ?>">
|
|
||||||
|
|
||||||
<label for="<?php echo e($id, false); ?>" class="<?php echo e($viewClass['label'], false); ?> control-label"><?php echo e($label, false); ?></label>
|
|
||||||
|
|
||||||
<div class="<?php echo e($viewClass['field'], false); ?>" id="<?php echo e($id, false); ?>">
|
|
||||||
|
|
||||||
<?php if($canCheckAll): ?>
|
|
||||||
<span class="icheck">
|
|
||||||
<label class="checkbox-inline">
|
|
||||||
<input type="checkbox" class="<?php echo e($checkAllClass, false); ?>"/> <?php echo e(__('admin.all'), false); ?>
|
|
||||||
|
|
||||||
</label>
|
|
||||||
</span>
|
|
||||||
<hr style="margin-top: 10px;margin-bottom: 0;">
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php echo $__env->make('admin::form.error', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
|
||||||
|
|
||||||
<?php $__currentLoopData = $options; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $option => $label): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
|
|
||||||
<?php echo $inline ? '<span class="icheck">' : '<div class="checkbox icheck">'; ?>
|
|
||||||
|
|
||||||
|
|
||||||
<label <?php if($inline): ?>class="checkbox-inline"<?php endif; ?>>
|
|
||||||
<input type="checkbox" name="<?php echo e($name, false); ?>[]" value="<?php echo e($option, false); ?>" class="<?php echo e($class, false); ?>" <?php echo e(false !== array_search($option, array_filter(old($column, $value ?? []))) || ($value === null && in_array($option, $checked)) ?'checked':'', false); ?> <?php echo $attributes; ?> /> <?php echo e($label, false); ?>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<?php echo $inline ? '</span>' : '</div>'; ?>
|
|
||||||
|
|
||||||
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
|
|
||||||
<input type="hidden" name="<?php echo e($name, false); ?>[]">
|
|
||||||
|
|
||||||
<?php echo $__env->make('admin::form.help-block', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php /**PATH /home/wwwroot/pingan/vendor/encore/laravel-admin/src/../resources/views/form/checkbox.blade.php ENDPATH**/ ?>
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
<?php $__env->startSection('title', '修改密码'); ?>
|
|
||||||
|
|
||||||
<?php $__env->startSection('content'); ?>
|
|
||||||
<form class="form-horizontal" method="post" action="<?php echo e(route('merchant.setting.password'), false); ?>">
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-xs-3 control-label">新密码</label>
|
|
||||||
<div class="col-xs-8">
|
|
||||||
<input type="password" class="form-control" value="" name="password">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-xs-3 control-label">确认密码</label>
|
|
||||||
<div class="col-xs-8">
|
|
||||||
<input type="password" class="form-control" value="" name="password_confirmation">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<div class="col-xs-offset-3 col-xs-8">
|
|
||||||
<?php echo csrf_field(); ?>
|
|
||||||
|
|
||||||
<button class="btn btn-primary btn-block ajax" type="button">
|
|
||||||
<i class="icon icon-check"></i> 保存
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
<?php $__env->stopSection(); ?>
|
|
||||||
|
|
||||||
|
|
||||||
<?php $__env->startPush('script'); ?>
|
|
||||||
<script type="text/javascript">
|
|
||||||
$('body').on('click', '.ajax', function(event) {
|
|
||||||
if ($(this).hasClass('disabled') || $(this).attr('disabled')) {
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
event.preventDefault();
|
|
||||||
var $this = $(this);
|
|
||||||
var $form = $this.parents('form');
|
|
||||||
var $action = $form.attr("action");
|
|
||||||
|
|
||||||
$this.attr('disabled', 'disabled');
|
|
||||||
var query = $form.serialize();
|
|
||||||
$.post($action, query, function(res) {
|
|
||||||
$this.removeAttr('disabled');
|
|
||||||
if (res.code) {
|
|
||||||
parent.updateAlert(res.msg, res.code, function() {
|
|
||||||
var index = parent.layer.getFrameIndex(window.name);
|
|
||||||
parent.layer.close(index);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
parent.updateAlert(res.msg, res.code);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<?php $__env->stopPush(); ?>
|
|
||||||
|
|
||||||
<?php echo $__env->make('Merchant::layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/wwwroot/pingan/app/Merchant/Resources/views/setting/password.blade.php ENDPATH**/ ?>
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user