更新秒杀
This commit is contained in:
parent
bab6ea2b6f
commit
b6730cdef8
|
|
@ -37,6 +37,7 @@ class Forder extends BaseModel
|
||||||
if(empty($member_info)){
|
if(empty($member_info)){
|
||||||
return $this->success();
|
return $this->success();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($member_info[ 'fenxiao_id' ] == 0) {
|
if ($member_info[ 'fenxiao_id' ] == 0) {
|
||||||
return $this->success();
|
return $this->success();
|
||||||
}
|
}
|
||||||
|
|
@ -55,7 +56,7 @@ class Forder extends BaseModel
|
||||||
if($is_range && $parent_fenxiao_info){ //减去极差奖励
|
if($is_range && $parent_fenxiao_info){ //减去极差奖励
|
||||||
$direct_push -=$indirect_push;
|
$direct_push -=$indirect_push;
|
||||||
}else{
|
}else{
|
||||||
$direct_push +5; //管理直推
|
// $direct_push +5; //管理直推
|
||||||
}
|
}
|
||||||
$unit_price=Db::name('futures')->alias('a')
|
$unit_price=Db::name('futures')->alias('a')
|
||||||
->where([
|
->where([
|
||||||
|
|
|
||||||
|
|
@ -105,56 +105,44 @@ class Futures extends BaseModel
|
||||||
* @return array
|
* @return array
|
||||||
* @throws InvalidArgumentException
|
* @throws InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function release($id, $price, $agree_split_order = 0)
|
public function release($id, $price)
|
||||||
{
|
{
|
||||||
$date = model('futures')->getInfo([['id', '=', $id]]);
|
$date = model('futures')->getInfo([['id', '=', $id]]);
|
||||||
if (empty($date) || $date['status'] !== 1) {
|
if (empty($date) || $date['status'] !== 1) {
|
||||||
return $this->error('', '发布失败-db');
|
return $this->error('', '发布失败-db');
|
||||||
}
|
}
|
||||||
$basics = $this->getBasicsConfig($date['site_id'])['data']['value'];
|
|
||||||
model('futures')->startTrans();
|
model('futures')->startTrans();
|
||||||
try {
|
try {
|
||||||
//拆单
|
$basics = $this->getBasicsConfig($date['site_id'])['data']['value'];
|
||||||
$futuresInfo = $this->detail($id, $date['site_id'])['data'];
|
|
||||||
$futuresInfo['status'] = 2;
|
|
||||||
if ($price >= $futuresInfo['market_price'] * $futuresInfo['total']) {
|
|
||||||
$futuresInfo['total'] *= 2;
|
|
||||||
if ($futuresInfo['total'] > pow(2, $basics['order_total_double_times'])) {// 配置单订单商品最大裂变次数
|
|
||||||
// if($agree_split_order == 0){
|
|
||||||
// model('futures')->rollback();
|
|
||||||
// Cache::store('redis_concurrent')->set('addon_futures_stock_'.$id,'1');
|
|
||||||
// return error(-800, '订单价格达到订单拆分限制,是否同意订单拆分?');
|
|
||||||
// }
|
|
||||||
//拆单
|
|
||||||
$futuresInfo['status'] = 8;
|
|
||||||
$splitOrderNum = $basics['split_order_num'];
|
|
||||||
for ($i = 0; $i < $splitOrderNum; $i++) {
|
|
||||||
$newSmallFuturesId = $this->add([
|
|
||||||
'site_id' => $futuresInfo['site_id'],
|
|
||||||
'seller_uid' => $futuresInfo['seller_uid'],
|
|
||||||
'old_futures_id' => $id,
|
|
||||||
'goods_id' => $futuresInfo['goods_id'],
|
|
||||||
'total' => $futuresInfo['total'] / $splitOrderNum,
|
|
||||||
'unit_price' => $futuresInfo['unit_price'] / $splitOrderNum,
|
|
||||||
'status' => 1,
|
|
||||||
'order_id' => $futuresInfo['order_id'],
|
|
||||||
'created_time' => time()
|
|
||||||
])['data'];
|
|
||||||
$this->release($newSmallFuturesId, $price / $splitOrderNum);
|
|
||||||
}
|
|
||||||
model('futures')->commit();
|
|
||||||
return $this->success();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$service_price = $date['unit_price'] * $basics['service_price'] / 100; //更改为买入价格
|
$service_price = $date['unit_price'] * $basics['service_price'] / 100; //更改为买入价格
|
||||||
$technical_range = $service_price * $basics['technical_range'] / 100;
|
$technical_range = $service_price * $basics['technical_range'] / 100;
|
||||||
if (model('member')->getValue(['member_id' => $date['seller_uid']], 'balance_money') < $service_price) {
|
if (model('member')->getValue(['member_id' => $date['seller_uid']], 'balance_money') < $service_price) {
|
||||||
return error(-800, '您余额不足!');
|
return error(-800, '您余额不足!');
|
||||||
}
|
}
|
||||||
|
//拆单
|
||||||
|
$futuresInfo = $this->detail($id, $date['site_id'])['data'];
|
||||||
|
$futuresInfo['status'] = 2;
|
||||||
|
$futuresInfo['start_price'] = $date['start_price'];
|
||||||
$release_time= time() + $basics['release_wait'] * 24 * 60 * 60;// 配置上线延迟时间
|
$release_time= time() + $basics['release_wait'] * 24 * 60 * 60;// 配置上线延迟时间
|
||||||
if(Db::name('futures_user')->where('member_id', '=',$futuresInfo['seller_uid'])->cache($futuresInfo['seller_uid'].'is_special')->value('is_special')==1){
|
if(Db::name('futures_user')->where('member_id', '=',$futuresInfo['seller_uid'])->cache($futuresInfo['seller_uid'].'is_special')->value('is_special')==1){
|
||||||
$release_time=time();
|
$release_time=time();
|
||||||
} //排除特殊用户时间限制
|
} //排除特殊用户时间限制
|
||||||
|
if ($price >= $date['start_price'] * $futuresInfo['total']) {
|
||||||
|
$futuresInfo['total'] *= 2;
|
||||||
|
if ($futuresInfo['total'] > pow(2, $basics['order_total_double_times'])) {// 配置单订单商品最大裂变次数
|
||||||
|
//拆单
|
||||||
|
$res=$this->SplitOrder($id, $price, $futuresInfo, $basics);
|
||||||
|
if($res['code']>=0){
|
||||||
|
$futuresInfo['status'] = 8;
|
||||||
|
model('futures')->update([
|
||||||
|
'status' => $futuresInfo['status'],
|
||||||
|
'release_time' => $release_time, // 配置上线延迟时间
|
||||||
|
], [['id', '=', $id]]);
|
||||||
|
model('futures')->commit();
|
||||||
|
}
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
}
|
||||||
model('futures')->update([
|
model('futures')->update([
|
||||||
'status' => $futuresInfo['status'],
|
'status' => $futuresInfo['status'],
|
||||||
'release_time' => $release_time,// 配置上线延迟时间
|
'release_time' => $release_time,// 配置上线延迟时间
|
||||||
|
|
@ -175,6 +163,46 @@ class Futures extends BaseModel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 拆分订单
|
||||||
|
* @param $id
|
||||||
|
* @param $price
|
||||||
|
* @param $futuresInfo
|
||||||
|
* @param $basics
|
||||||
|
* @return array
|
||||||
|
* @throws InvalidArgumentException
|
||||||
|
*/
|
||||||
|
private function SplitOrder($id, $price, $futuresInfo, $basics)
|
||||||
|
{
|
||||||
|
model('futures')->startTrans();
|
||||||
|
try {
|
||||||
|
$splitOrderNum = $basics['split_order_num'];
|
||||||
|
$futuresInfo['total']/=2;
|
||||||
|
for ($i = 0; $i < $splitOrderNum; $i++) {
|
||||||
|
$tempArr=[
|
||||||
|
'site_id' => $futuresInfo['site_id'],
|
||||||
|
'seller_uid' => $futuresInfo['seller_uid'],
|
||||||
|
'member_id' => $futuresInfo['seller_uid'],
|
||||||
|
'old_futures_id' => $id,
|
||||||
|
'goods_id' => $futuresInfo['goods_id'],
|
||||||
|
'start_price' => $futuresInfo['start_price'],
|
||||||
|
'is_grow' => 1,
|
||||||
|
'total' => intval($futuresInfo['total']) / $splitOrderNum,
|
||||||
|
'unit_price' =>floatval($futuresInfo['unit_price']) / $splitOrderNum,
|
||||||
|
'status' => 1,
|
||||||
|
'order_id' => $futuresInfo['order_id'],
|
||||||
|
'created_time' => time()
|
||||||
|
];
|
||||||
|
$newSmallFuturesId = $this->add($tempArr)['data'];
|
||||||
|
$this->release($newSmallFuturesId, $price/$splitOrderNum);
|
||||||
|
}
|
||||||
|
model('futures')->commit();
|
||||||
|
return $this->success();
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
model('futures')->rollback();
|
||||||
|
return $this->error('', $e->getMessage() . $e->getFile() . $e->getLine());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下架到库存
|
* 下架到库存
|
||||||
|
|
@ -301,6 +329,7 @@ class Futures extends BaseModel
|
||||||
'goods_id' => (int)$date['goods_id'],
|
'goods_id' => (int)$date['goods_id'],
|
||||||
'total' => (int)$date['total'],
|
'total' => (int)$date['total'],
|
||||||
'unit_price' => $date['price'],
|
'unit_price' => $date['price'],
|
||||||
|
'start_price' => $date['start_price'],
|
||||||
'status' => 1,
|
'status' => 1,
|
||||||
'created_time' => time()
|
'created_time' => time()
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,7 @@ class User extends BaseModel{
|
||||||
'total' => (int)$info['goods_num'],
|
'total' => (int)$info['goods_num'],
|
||||||
'price' => sprintf("%.2f",$info['unit_price'] * $info['goods_num']),
|
'price' => sprintf("%.2f",$info['unit_price'] * $info['goods_num']),
|
||||||
'unit_price' => sprintf("%.2f",$info['unit_price'] * $info['goods_num']),
|
'unit_price' => sprintf("%.2f",$info['unit_price'] * $info['goods_num']),
|
||||||
|
'start_price' => $info['start_price'],
|
||||||
'status' => 1,
|
'status' => 1,
|
||||||
'created_time' => $time,
|
'created_time' => $time,
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
|
|
@ -288,16 +288,15 @@ class FuturesOrderCreate extends OrderCreate
|
||||||
return error(-1, '注册错误,请使用小程序注册');
|
return error(-1, '注册错误,请使用小程序注册');
|
||||||
}
|
}
|
||||||
$w = [
|
$w = [
|
||||||
['seller_uid','=',$member_id],
|
['member_id', '=', $member_id],
|
||||||
['status','in',[1,2]],
|
['status', 'in', [1, 2, 6]],
|
||||||
['created_time', 'BETWEEN', [strtotime(date("Y-m-d", time())), time()]]
|
['created_time', 'BETWEEN', [strtotime(date("Y-m-d", time())), time()]]
|
||||||
];
|
];
|
||||||
|
|
||||||
$jianlou_start_time = strtotime(date("Y-m-d", time())) + $data['times']['original']['jianlou_start_time'];
|
$jianlou_start_time = strtotime(date("Y-m-d", time())) + $data['times']['original']['jianlou_start_time'];
|
||||||
if(time()<=$jianlou_start_time&& $basics['buying_order_limit'] && $data['futures_user_info']['is_special'] == 0 && model('futures')->getCount($w,'id')>=$basics['buying_order_limit']){
|
if (time() <= $jianlou_start_time && $basics['buying_order_limit'] && model('futures')->getCount($w, 'id') >= $basics['buying_order_limit'] && $data['futures_user_info']['is_special'] == 0) {
|
||||||
return error(-1, "每天只允许抢购{$basics['buying_order_limit']}单");
|
return error(-1, "每天只允许抢购{$basics['buying_order_limit']}单");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 判断用户是否有足够多的购买机会
|
// 判断用户是否有足够多的购买机会
|
||||||
if ($data['futures_user_info']['business_num'] >= $basics['order_restrictions_num'] && $data['futures_user_info']['is_special'] == 0) {
|
if ($data['futures_user_info']['business_num'] >= $basics['order_restrictions_num'] && $data['futures_user_info']['is_special'] == 0) {
|
||||||
return error(-1, '下单次数达到限制,需提货恢复下单');
|
return error(-1, '下单次数达到限制,需提货恢复下单');
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@
|
||||||
<label class="layui-form-label img-upload-lable short-label"><span class="required">*</span>订单数量:</label>
|
<label class="layui-form-label img-upload-lable short-label"><span class="required">*</span>订单数量:</label>
|
||||||
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
||||||
<input type="number" name="info[order_num]" value="1" lay-verify="required|number" min="1" placeholder="请输入订单数量" autocomplete="off" class="layui-input len-long">
|
<input type="number" name="info[order_num]" value="1" lay-verify="required|number" min="1" placeholder="请输入订单数量" autocomplete="off" class="layui-input len-long">
|
||||||
<div class="tips">赠送的订单数量</div>
|
<div class="tips">系统会产生指定的订单数量</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
|
|
@ -83,11 +83,19 @@
|
||||||
<div class="tips">每份订单中商品的数量</div>
|
<div class="tips">每份订单中商品的数量</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label class="layui-form-label img-upload-lable short-label"><span class="required">*</span>商品价格:</label>
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<input type="number" name="info[unit_price]" value="0" lay-verify="required|number" placeholder="请单件商品的价格!" autocomplete="off" class="layui-input len-long">
|
||||||
|
<div class="tips">首单单个商品卖出价格</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label img-upload-lable short-label"><span class="required">*</span>初始均价:</label>
|
<label class="layui-form-label img-upload-lable short-label"><span class="required">*</span>初始均价:</label>
|
||||||
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
||||||
<input type="number" name="info[unit_price]" value="0" lay-verify="required|number" placeholder="请输入初始价格!" autocomplete="off" class="layui-input len-long">
|
<input type="number" name="info[start_price]" value="0" lay-verify="required|number" placeholder="请输入初始价格!" autocomplete="off" class="layui-input len-long">
|
||||||
<div class="tips">所有订单的初始均价,订单均价(该价格除以商品数量)不能超过<span id="maxAverage">0</span></div>
|
<div class="tips">用户裂变起始价格<span id="maxAverage">0</span></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -123,7 +131,7 @@
|
||||||
// layer.msg('商品价格不能低于售卖价格!');
|
// layer.msg('商品价格不能低于售卖价格!');
|
||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
// if(parseFloat(field['info[unit_price]']) >= parseFloat(goods_info['market_price'])){
|
// if(parseFloat(field['info[start_price]']) >= parseFloat(goods_info['market_price'])){
|
||||||
// console.log(field['info[unit_price]'],goods_info['market_price']);
|
// console.log(field['info[unit_price]'],goods_info['market_price']);
|
||||||
// layer.msg('商品价格必须低于原价(划线价)!');
|
// layer.msg('商品价格必须低于原价(划线价)!');
|
||||||
// return false;
|
// return false;
|
||||||
|
|
@ -177,7 +185,7 @@
|
||||||
// 信息记录
|
// 信息记录
|
||||||
goods_info = info = JSON.parse(info);
|
goods_info = info = JSON.parse(info);
|
||||||
$("#maxAverage").html(info.market_price);
|
$("#maxAverage").html(info.market_price);
|
||||||
$("[name='info[unit_price]']").val(info.price);
|
$("[name='info[start_price]']").val(info.price);
|
||||||
$(".params-content").removeClass('hide');
|
$(".params-content").removeClass('hide');
|
||||||
rendering(info);
|
rendering(info);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,6 @@ class Member extends BaseApi
|
||||||
return $this->response($this->error("", "当前手机号已存在"));
|
return $this->response($this->error("", "当前手机号已存在"));
|
||||||
} else {
|
} else {
|
||||||
$code = str_pad(random_int(1, 9999), 4, 0, STR_PAD_LEFT);// 生成4位随机数,左侧补0
|
$code = str_pad(random_int(1, 9999), 4, 0, STR_PAD_LEFT);// 生成4位随机数,左侧补0
|
||||||
|
|
||||||
$message_model = new Message();
|
$message_model = new Message();
|
||||||
$res = $message_model->sendMessage([
|
$res = $message_model->sendMessage([
|
||||||
'type' => 'code', "mobile" => $mobile,
|
'type' => 'code', "mobile" => $mobile,
|
||||||
|
|
@ -298,7 +297,13 @@ class Member extends BaseApi
|
||||||
if ($token[ 'code' ] < 0) return $this->response($token);
|
if ($token[ 'code' ] < 0) return $this->response($token);
|
||||||
$code = str_pad(random_int(1, 9999), 4, 0, STR_PAD_LEFT);// 生成4位随机数,左侧补0
|
$code = str_pad(random_int(1, 9999), 4, 0, STR_PAD_LEFT);// 生成4位随机数,左侧补0
|
||||||
$message_model = new Message();
|
$message_model = new Message();
|
||||||
$res = $message_model->sendMessage([ 'type' => 'code', "member_id" => $this->member_id, "site_id" => $this->site_id, "code" => $code, "support_type" => [ "sms" ], "keywords" => "MEMBER_PAY_PASSWORD" ]);
|
$res = $message_model->sendMessage(
|
||||||
|
[ 'type' => 'code',
|
||||||
|
"member_id" => $this->member_id,
|
||||||
|
"site_id" => $this->site_id,
|
||||||
|
"code" => $code,
|
||||||
|
"support_type" => [ "sms" ],
|
||||||
|
"keywords" => "MEMBER_PAY_PASSWORD" ]);
|
||||||
// $code=6666;
|
// $code=6666;
|
||||||
// $res['code']=0;
|
// $res['code']=0;
|
||||||
if ($res[ "code" ] >= 0) {
|
if ($res[ "code" ] >= 0) {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||||
* ----------------------------------------------
|
* ----------------------------------------------
|
||||||
* 官方网址: https://www.cdcloudshop.com
|
* 官方网址: https://www.cdcloudshop.com
|
||||||
|
|
||||||
* =========================================================
|
* =========================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -61,7 +60,8 @@ class Task extends Controller
|
||||||
/**
|
/**
|
||||||
*检测自动任务是否人在进行
|
*检测自动任务是否人在进行
|
||||||
*/
|
*/
|
||||||
public function checkCron(){
|
public function checkCron()
|
||||||
|
{
|
||||||
$cron_model = new \app\model\system\Cron();
|
$cron_model = new \app\model\system\Cron();
|
||||||
$result = $cron_model->checkCron();
|
$result = $cron_model->checkCron();
|
||||||
return $result;
|
return $result;
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,7 @@ class MemberAccount extends BaseModel
|
||||||
$from_type[ 'point' ][ 'sell' ] = [ 'type_name' => '秒杀赠送积分', 'type_url' => '' ];
|
$from_type[ 'point' ][ 'sell' ] = [ 'type_name' => '秒杀赠送积分', 'type_url' => '' ];
|
||||||
|
|
||||||
$from_type[ 'balance' ][ 'transfer' ] = [ 'type_name' => '转账', 'type_url' => '' ];
|
$from_type[ 'balance' ][ 'transfer' ] = [ 'type_name' => '转账', 'type_url' => '' ];
|
||||||
|
$from_type[ 'balance_money' ][ 'transfer' ] = [ 'type_name' => '转账', 'type_url' => '' ];
|
||||||
$from_type[ 'balance' ]['diamond'] = [ 'type_name' => '赠送猕猴桃', 'type_url' => '' ];
|
$from_type[ 'balance' ]['diamond'] = [ 'type_name' => '赠送猕猴桃', 'type_url' => '' ];
|
||||||
$from_type[ 'balance' ]['intdiamond'] = [ 'type_name' => '提前秒杀猕猴桃', 'type_url' => '' ];
|
$from_type[ 'balance' ]['intdiamond'] = [ 'type_name' => '提前秒杀猕猴桃', 'type_url' => '' ];
|
||||||
|
|
||||||
|
|
@ -184,7 +185,7 @@ class MemberAccount extends BaseModel
|
||||||
}else if ((float) $account_new_data < 0) {
|
}else if ((float) $account_new_data < 0) {
|
||||||
model('member_account')->rollback();
|
model('member_account')->rollback();
|
||||||
$msg = '';
|
$msg = '';
|
||||||
if ($account_type == 'balance') {
|
if ($account_type == 'balance' || $account_type='balance_money') {
|
||||||
$msg = '账户余额不足';
|
$msg = '账户余额不足';
|
||||||
} elseif ($account_type == 'point') {
|
} elseif ($account_type == 'point') {
|
||||||
$msg = '账户积分不足';
|
$msg = '账户积分不足';
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,6 @@ class Cron extends BaseModel
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$res = $this->error($e->getMessage(), $e->getMessage());
|
$res = $this->error($e->getMessage(), $e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
$data_log = [
|
$data_log = [
|
||||||
'name' => $params['name'],
|
'name' => $params['name'],
|
||||||
'event' => $params['event'],
|
'event' => $params['event'],
|
||||||
|
|
@ -117,15 +116,12 @@ class Cron extends BaseModel
|
||||||
$execute_time = $v['execute_time'] + $period * 60;
|
$execute_time = $v['execute_time'] + $period * 60;
|
||||||
break;
|
break;
|
||||||
case 1://天
|
case 1://天
|
||||||
|
|
||||||
$execute_time = strtotime('+' . $period . 'day', $v['execute_time']);
|
$execute_time = strtotime('+' . $period . 'day', $v['execute_time']);
|
||||||
break;
|
break;
|
||||||
case 2://周
|
case 2://周
|
||||||
|
|
||||||
$execute_time = strtotime('+' . $period . 'week', $v['execute_time']);
|
$execute_time = strtotime('+' . $period . 'week', $v['execute_time']);
|
||||||
break;
|
break;
|
||||||
case 3://月
|
case 3://月
|
||||||
|
|
||||||
$execute_time = strtotime('+' . $period . 'month', $v['execute_time']);
|
$execute_time = strtotime('+' . $period . 'month', $v['execute_time']);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ namespace app\pay\controller;
|
||||||
use addon\aliapp\model\CloudPay;
|
use addon\aliapp\model\CloudPay;
|
||||||
use addon\aliapp\model\OpenPay;
|
use addon\aliapp\model\OpenPay;
|
||||||
use addon\futures\model\Forder;
|
use addon\futures\model\Forder;
|
||||||
|
use addon\futures\model\Futures;
|
||||||
use app\Controller;
|
use app\Controller;
|
||||||
use think\facade\Queue;
|
use think\facade\Queue;
|
||||||
use think\Validate;
|
use think\Validate;
|
||||||
|
|
@ -25,27 +26,40 @@ class Test extends Controller
|
||||||
|
|
||||||
|
|
||||||
public function order(){
|
public function order(){
|
||||||
// $order=model('order')->getInfo(['order_id'=>2]);
|
$order=model('futures')->getList(['status'=>6]);
|
||||||
|
|
||||||
|
// var_dump($order);die;
|
||||||
// $res=event('OrderPay',$order);
|
// $res=event('OrderPay',$order);
|
||||||
// $order['relate_id']=254;
|
// $order['relate_id']=254;
|
||||||
// $res=event('CronOrderClose',$order);
|
// $res=event('CronOrderClose',$order);
|
||||||
// var_dump($res);
|
// var_dump($res);
|
||||||
$params=[
|
|
||||||
[
|
foreach ($order as $item){
|
||||||
'relate_id'=>'264',
|
$app=[
|
||||||
'name'=>'264',
|
'relate_id'=>$item['order_id'],
|
||||||
'event'=>'Cronexecute',
|
'name'=>$item['order_id'],
|
||||||
],
|
'event'=>'CronOrderClose',
|
||||||
[
|
|
||||||
'name'=>'265',
|
|
||||||
'event'=>'Cronexecute',
|
|
||||||
'relate_id'=>'265'
|
|
||||||
]
|
|
||||||
];
|
];
|
||||||
foreach ($params as $item){
|
event('CronOrderClose',$app);
|
||||||
var_dump($item);
|
// Queue::push('Cronexecute', $app);
|
||||||
Queue::push('Cronexecute', $item);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// $params=[
|
||||||
|
// [
|
||||||
|
// 'relate_id'=>'264',
|
||||||
|
// 'name'=>'264',
|
||||||
|
// 'event'=>'Cronexecute',
|
||||||
|
// ],
|
||||||
|
// [
|
||||||
|
// 'name'=>'265',
|
||||||
|
// 'event'=>'Cronexecute',
|
||||||
|
// 'relate_id'=>'265'
|
||||||
|
// ]
|
||||||
|
// ];
|
||||||
|
// foreach ($params as $item){
|
||||||
|
// var_dump($item);
|
||||||
|
// Queue::push('Cronexecute', $item);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public function s(){
|
public function s(){
|
||||||
|
|
@ -53,9 +67,21 @@ class Test extends Controller
|
||||||
|
|
||||||
// $order=model('order')->getInfo(['order_id'=>258]);
|
// $order=model('order')->getInfo(['order_id'=>258]);
|
||||||
|
|
||||||
|
$futures_model = new Futures();
|
||||||
|
|
||||||
$userModel = new User(1);
|
// $res = $futures_model->orderClose(20);
|
||||||
var_dump($userModel->buyBack());
|
|
||||||
|
// var_dump($res);
|
||||||
|
|
||||||
|
$order=model('order')->getInfo(['order_id'=>33]);
|
||||||
|
|
||||||
|
$order['relate_id']=33;
|
||||||
|
$res=event('CronOrderClose',$order);
|
||||||
|
|
||||||
|
var_dump($res);
|
||||||
|
|
||||||
|
// $userModel = new User(1);
|
||||||
|
// var_dump($userModel->buyBack());
|
||||||
|
|
||||||
// var_dump($res);
|
// var_dump($res);
|
||||||
// var_dump(329*1/100);
|
// var_dump(329*1/100);
|
||||||
|
|
@ -124,50 +150,5 @@ class Test extends Controller
|
||||||
// var_dump($allRow);die;
|
// var_dump($allRow);die;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
public function ali(){
|
|
||||||
$info= Db::name('pay_shop')->select();
|
|
||||||
$CloudPay = new OpenPay();
|
|
||||||
$res = $CloudPay->query('','2022122900502000000060919247');
|
|
||||||
var_dump($res);die;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function aa(){
|
|
||||||
$paydata=json_decode('{"line_type":"auth","app_type":"aliapp","site_id":"2","ag_site_id":"1","appid":"2021003131620226","appsecret":"","token":"","app_name":"","head_img":"","qrcode":"","account":"2088441422689415","alipay_public":"","private_key":"","app_auth_token":"202301BBb2dc039e58b248ae9c2c6c39bc83eE41","app_refresh_token":"202301BBbcb099fbbed0469abac3c02344bcdE41","app_original":"2088441422689415","original_values":{"app_auth_token":"202301BBb2dc039e58b248ae9c2c6c39bc83eE41","app_refresh_token":"202301BBbcb099fbbed0469abac3c02344bcdE41","auth_app_id":"2021003131620226","expires_in":31536000,"re_expires_in":32140800,"user_id":"2088441422689415"},"state":"2|minapp|1|1"}',true);
|
|
||||||
|
|
||||||
// var_dump($paydata);die;
|
|
||||||
|
|
||||||
$res=event('MiniappAuthInfo', $paydata);
|
|
||||||
var_dump($res);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function b(){
|
|
||||||
$json=[
|
|
||||||
'notify_type' => 'open_app_auth_notify',
|
|
||||||
'charset' => 'UTF-8',
|
|
||||||
'biz_content' => '{"notify_context":{"trigger":"openhome","trigger_context":{"out_biz_no":"202301040000000008805896"}},"detail":{"app_auth_token":"202301BBc4311e1d4d094f2bb146267600195X84","user_id":"2088911181925841","re_expires_in":32140800,"auth_time":1673057100996,"app_refresh_token":"202301BB191270193a99454488e06fbc6368eX84","auth_app_id":"2021003173667904","app_id":"2021003167617037","expires_in":31536000,"app_auth_code":"ea1bfa68dfe3408aab7517686e7d8B84"},"error":{}}',
|
|
||||||
'notify_time' => '2023-01-08 10:34:49',
|
|
||||||
'sign' => 'BW6Ui/yFZ2RbKnI6trgg5ANRyv5CDy7rcpENurOKzqbDPZ4tVVmT6Q5QeaIofd7MG9E5xlwUn88rhrspz8IQdpJ9CVdAXilKbT6CPFKs4sNCJZu5yPqucceyi0SKLb9YUrpAfx+fR7RKFqJKNbpz8WUKlbKomIii7AYOt0vEqPXC9u3SWhdRxbFQy2NP52mo0Qr6ZPVSvHDSHd9EpQIVq2hqwVvoeGhs6UtoSiTHRErF9IIjOP/zvuXk9cj/YALpqa8t3oOC7+pePIJ9MSfzJOpzIKTvdISqPnX5Z/dULlEkmyGpDIT/gkd3TBMcaRb078vXydkY0RmMDuzUP5q9Rw==',
|
|
||||||
'auth_app_id' => '2021003173667904',
|
|
||||||
'app_id' => '2021003167617037',
|
|
||||||
'version' => '1.0',
|
|
||||||
'sign_type' => 'RSA2',
|
|
||||||
'notify_id' => '2023010700222100501062371438607977',
|
|
||||||
'status' => 'execute_auth'
|
|
||||||
];
|
|
||||||
$res= event('AliAuthNotify',$json);
|
|
||||||
var_dump($res);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function n(){
|
|
||||||
$json='{"charset":"UTF-8","biz_content":"{\"smid\":\"2088420618732638\",\"memo\":\"商户进件完成\",\"external_id\":\"202212281644297838\",\"order_id\":\"2022122900502000000060919247\"}","utc_timestamp":"1673051330046","sign":"F4sGoWkEmQxSQbjjN8hKsal7Lba58UTqgdOVEz6x9ve2qqcqxzYmND\/v\/87RWrqB7r8hXxMxvyG\/bNUWIGtcxsfc4RYZjO83LY0pd7+3\/wxAtwfUNZyUbZDjdprk715KUHmPXvnjNNey+Ig96lF7Xa1B0YWNmvSmw2pYOrQ3v3Wd+vDu8fIQ4tNy+adnRzHylfxOmFO3mLVh7BQVBVZwhlHoZExHPInAcEhtczmygzM7UIsybQU5Tp5kbTs3iur7\/Wk0iMkgoMvqGTa\/UYpN6wVCLWq5gFqywrPERob3ka5vmgJB56ZqZZHCeaVKOX8tRvrb90+5GQUFf9HEC09kEA==","app_id":"2021003166659136","version":"1.1","sign_type":"RSA2","notify_id":"2023010600222230050034151455192412","msg_method":"ant.merchant.expand.indirect.zft.passed"}';
|
|
||||||
$json='{"charset":"UTF-8","biz_content":"{\"order_no\":\"2023010710002181800022005\",\"out_order_no\":\"202301040000000008805896\",\"pid\":\"2088911181925841\",\"min_app_id\":\"2021003173667904\",\"status\":\"AGREED\"}","utc_timestamp":"1673069254846","sign":"MEQVCJ9hwu71oa+\/yOTvq6NqwJWBMyVKiJ+Fmyu\/GKeVr0bfz2KOFxjaxEi4YfFaZRZBDiNs\/3jlHftUsZL4+RE9369bghDmo1bisdTuD3c5hPQXUS2igi\/nwcKKvnVSkWQl6G+WGy75o\/UKBOTKwd\/EA8MX7kmdGlI+uaocg2ZfFbEoM4r6i3xTA6yJ\/GtBFkibg4fSqrqVt+CewoP8AFGPjmQDVF6j6exXthKWW3eV\/xh30fUzWt24kUvadirfItYz1t0yjdG7Ny9Jm5mwoh0Bm8\/qa5QRxMojIC4q01PUVmaNWj5nSkQGrxrifbyS\/EqKEWMBhFKPORAy3kQzUw==","app_id":"2021003167617037","version":"1.1","sign_type":"RSA2","notify_id":"2023010700262100501056408716905123","msg_method":"alipay.open.mini.merchant.confirmed"}';
|
|
||||||
$json='{"notify_type":"open_app_auth_notify","charset":"UTF-8","biz_content":"{\"notify_context\":{\"trigger\":\"openhome\",\"trigger_context\":{\"out_biz_no\":\"202301040000000008805896\"}},\"detail\":{\"app_auth_token\":\"202301BBc4311e1d4d094f2bb146267600195X84\",\"user_id\":\"2088911181925841\",\"re_expires_in\":32140800,\"auth_time\":1673057100996,\"app_refresh_token\":\"202301BB191270193a99454488e06fbc6368eX84\",\"auth_app_id\":\"2021003173667904\",\"app_id\":\"2021003167617037\",\"expires_in\":31536000,\"app_auth_code\":\"ea1bfa68dfe3408aab7517686e7d8B84\"},\"error\":{}}","notify_time":"2023-01-07 13:32:12","sign":"Qoz0za4JgMvSwyqEhUVClrdtyNPX3X60aLgARA7llq7\/pCwjoJZJD1JPkC56wc3oTapO4rLSA1EalXnNT8OxSR9eUsG5YndIdM\/dIvyhAMYYPz7cdwq0cywY+Tu7VtbN6XYS\/4rz6PSuKsLAh+v2hYF6GDXmBvCDKIVwX1+DcD2g7i0G5T3tQ9H3AbC\/XIIloWzZhqKOGmSZMLHq47IL2Efcpcj3Fgehe5PqaERV3nLnALOcp5KDjJO7wSBl2Nh7kzTkASNcmEk9Y2Jslv08loO67De0GsmxYwMz0rCnKLsd8orxli52td\/IQiRDCDjLrE3iMPesx\/ZWMrBkrtBkog==","auth_app_id":"2021003173667904","app_id":"2021003167617037","version":"1.0","sign_type":"RSA2","notify_id":"2023010700222100501062371438607977","status":"execute_auth"}';
|
|
||||||
$json=json_decode($json,true);
|
|
||||||
event('AliAuthNotify',$json);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -10,12 +10,12 @@
|
||||||
*/
|
*/
|
||||||
return [
|
return [
|
||||||
'name' => 'B2C_V4',
|
'name' => 'B2C_V4',
|
||||||
'title' => 'NiuShop单商户V5版',
|
'title' => 'xxx',
|
||||||
'description' => 'NiuShop单商户V5版',
|
'description' => 'xxxx',
|
||||||
'type' => 'system',
|
'type' => 'system',
|
||||||
'status' => 1,
|
'status' => 1,
|
||||||
'author' => '',
|
'author' => '',
|
||||||
'version' => '5.1.1',
|
'version' => '5.1.1',
|
||||||
'version_no' => '520221115001',
|
'version_no' => '520221115001',
|
||||||
'content' => 'NiuShop单商户V5版'
|
'content' => 'xxx'
|
||||||
];
|
];
|
||||||
Loading…
Reference in New Issue