万旭刺绣相关改动

This commit is contained in:
xucong 2024-12-11 15:26:37 +08:00
parent e5e831acde
commit b142a51fe5

@ -7,8 +7,6 @@ use app\common\logic\Billions;
use app\common\logic\Earnings;
use app\common\model\AccountLog;
use app\common\model\localstore\LocalGoodsOrder;
use app\common\model\localstore\LocalStoreCloudAudio;
use app\common\server\CloudAudioServer;
use app\common\server\JsonServer;
use think\facade\Db;
class Gtpay extends Api
@ -30,7 +28,7 @@ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlu5coHWBbtrz8DyX0VbPWiJZlAsofwZ99pZq
'agetId'=>$this->agetId,
'custId'=>$this->custId,
'orderNo'=>$out,
'txamt'=>$money*100,
'txamt'=>round($money*100,2),
'openid'=>$user['openid'],
'payWay'=>"1",
'ip'=>$_SERVER['REMOTE_ADDR'],
@ -49,11 +47,12 @@ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlu5coHWBbtrz8DyX0VbPWiJZlAsofwZ99pZq
$d =$this->ASCII($data);
$data['sign'] = $this->sign($d,$this->publicKey);
// print_r("<pre>");
// var_dump($data);
// var_dump($data);
$b = json_encode($data,true);
// var_dump($b);
// var_dump($b);
$url = "https://yyfsvxm.postar.cn/yyfsevr/order/pay";
$result = $this->curl_post($url,$b);
// var_dump($result);
$r['nonceStr'] = $result['data']['jsapiNoncestr'];
$r['package'] = $result['data']['jsapiPackage'];
$r['signType'] = $result['data']['jsapiSignType'];
@ -62,6 +61,7 @@ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlu5coHWBbtrz8DyX0VbPWiJZlAsofwZ99pZq
return JsonServer::success('开始支付',$r);
}
public function checkOrder($post){
// var_dump($post);
// $user_id = $this->user_id;
$user_id = $post['user_id'];
$gtpay_msg = Db::name("gt_pay")->where("id",$post['id'])->find();
@ -153,7 +153,15 @@ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlu5coHWBbtrz8DyX0VbPWiJZlAsofwZ99pZq
$dt['bank_name'] = $company['bankName'];
$dt['bank_card'] = $company['bankCard'];
$dt['large_number'] = $company['largeNumber'];
$dt['separate_account'] = round($gtpay_msg['txamt']/100*$sidy,2);
$store_msg = Db::name("local_store")->where("lstore_id",$post['lid'])->find();
if($store_msg['store_pay_type'] != 2){
$dt['separate_account'] = round($gtpay_msg['txamt']/100*$sidy,2);
}else{
$dt['separate_account'] = round($gtpay_msg['txamt']/100,2);
}
// $dt['separate_account'] = round($gtpay_msg['txamt']/100*$sidy,2);
$dt2['separate_account'] = round($gtpay_msg['txamt']/100*$sidy3,2);
$dt3['separate_account'] = round($gtpay_msg['txamt']/100*$sidy1,2);
if($post['lid'] == 138){
@ -173,68 +181,77 @@ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlu5coHWBbtrz8DyX0VbPWiJZlAsofwZ99pZq
$dt['remark'] = $post['remark'];
}
$r = Db::name("local_store_order")->save($dt);
// 基本户 5%
$dt1['lstore_id'] = $post['lid'];
$dt1['payment_type'] = 1;
$dt1['account_name'] = "东龙汇";
$dt1['bank_name'] = "中国工商银行";
$dt1['bank_card'] = "1204068809100138961";
$dt1['large_number'] = "102335006882";
$dt1['separate_account'] = round($gtpay_msg['txamt']/100*$sidy2,2);
$dt1['create_time'] = date("Y-m-d H:i:s");
$dt1['user_id'] = $user_id;
$dt1['local_our_company'] = 1;
$dt1['order_no'] = $gtpay_msg['orderNo'];
$r1 = Db::name("local_store_order")->save($dt1);
if($store_msg['store_pay_type'] != 2){
// 基本户 5%
$dt1['lstore_id'] = $post['lid'];
$dt1['payment_type'] = 1;
$dt1['account_name'] = "东龙汇";
$dt1['bank_name'] = "中国工商银行";
$dt1['bank_card'] = "1204068809100138961";
$dt1['large_number'] = "102335006882";
$dt1['separate_account'] = round($gtpay_msg['txamt']/100*$sidy2,2);
$dt1['create_time'] = date("Y-m-d H:i:s");
$dt1['user_id'] = $user_id;
$dt1['local_our_company'] = 1;
$dt1['order_no'] = $gtpay_msg['orderNo'];
$r1 = Db::name("local_store_order")->save($dt1);
// 22% 一般户
$dt2['lstore_id'] = $post['lid'];
$dt2['payment_type'] = 1;
$dt2['account_name'] = "东龙汇";
$dt2['bank_name'] = "中国工商银行";
$dt2['bank_card'] = "1204064019200152507";
$dt2['large_number'] = "102335006405";
$dt2['lstore_id'] = $post['lid'];
$dt2['payment_type'] = 1;
$dt2['account_name'] = "东龙汇";
$dt2['bank_name'] = "中国工商银行";
$dt2['bank_card'] = "1204064019200152507";
$dt2['large_number'] = "102335006405";
$dt2['create_time'] = date("Y-m-d H:i:s");
$dt2['user_id'] = $user_id;
$dt2['local_our_company'] = 2;
$dt2['order_no'] = $gtpay_msg['orderNo'];
$r2 = Db::name("local_store_order")->save($dt2);
// 10% 一般户
$dt3['lstore_id'] = $post['lid'];
$dt3['payment_type'] = 1;
$dt3['account_name'] = "东龙汇";
$dt3['bank_name'] = "中国工商银行";
$dt3['bank_card'] = "1204064419000115357";
// $dt3['bank_card'] = "1204068809100138961";
// $dt3['large_number'] = "102335006882";
$dt3['large_number'] = "102335006448";
$dt2['create_time'] = date("Y-m-d H:i:s");
$dt2['user_id'] = $user_id;
$dt2['local_our_company'] = 2;
$dt2['order_no'] = $gtpay_msg['orderNo'];
$r2 = Db::name("local_store_order")->save($dt2);
// 10% 一般户
$dt3['lstore_id'] = $post['lid'];
$dt3['payment_type'] = 1;
$dt3['account_name'] = "东龙汇";
$dt3['bank_name'] = "中国工商银行";
$dt3['bank_card'] = "1204064419000115357";
// $dt3['bank_card'] = "1204068809100138961";
// $dt3['large_number'] = "102335006882";
$dt3['large_number'] = "102335006448";
// $dt3['separate_account'] = round($post['money']*0.06,2);
$dt3['create_time'] = date("Y-m-d H:i:s");
$dt3['user_id'] = $user_id;
$dt3['local_our_company'] = 3;
$dt3['order_no'] = $gtpay_msg['orderNo'];
$r3 = Db::name("local_store_order")->save($dt3);
$arr=array("ACC_DETAIL"=>array(
array(
"ACC_CUST_ID"=>$company['acc_cust_id'],
"ACC_DATE"=>round($gtpay_msg['txamt']/100*$sidy,2)
),
// 基本户
array(
"ACC_CUST_ID"=>"60000008228471",
"ACC_DATE"=>round($gtpay_msg['txamt']/100*$sidy2,2)
),
// 一般户2507
array(
"ACC_CUST_ID"=>"60000008435142",
"ACC_DATE"=>round($gtpay_msg['txamt']/100*$sidy3,2)
),
//一般户5357
array(
"ACC_CUST_ID"=>"60000008435087",
"ACC_DATE"=>round($gtpay_msg['txamt']/100*$sidy2,2)
)));
$dt3['create_time'] = date("Y-m-d H:i:s");
$dt3['user_id'] = $user_id;
$dt3['local_our_company'] = 3;
$dt3['order_no'] = $gtpay_msg['orderNo'];
$r3 = Db::name("local_store_order")->save($dt3);
$arr=array("ACC_DETAIL"=>array(
array(
"ACC_CUST_ID"=>$company['acc_cust_id'],
"ACC_DATE"=>round($gtpay_msg['txamt']/100*$sidy,2)
),
// 基本户
array(
"ACC_CUST_ID"=>"60000008228471",
"ACC_DATE"=>round($gtpay_msg['txamt']/100*$sidy2,2)
),
// 一般户2507
array(
"ACC_CUST_ID"=>"60000008435142",
"ACC_DATE"=>round($gtpay_msg['txamt']/100*$sidy3,2)
),
//一般户5357
array(
"ACC_CUST_ID"=>"60000008435087",
"ACC_DATE"=>round($gtpay_msg['txamt']/100*$sidy2,2)
)));
}else{
$arr=array("ACC_DETAIL"=>array(
array(
"ACC_CUST_ID"=>$company['acc_cust_id'],
"ACC_DATE"=>round($gtpay_msg['txamt']*0.99/100,2)
)
));
}
$arr = json_encode($arr,true);
$data = [
'agetId'=>$this->agetId,
@ -254,9 +271,11 @@ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlu5coHWBbtrz8DyX0VbPWiJZlAsofwZ99pZq
// print_r("<pre>");
// var_dump($data);
$b = json_encode($data,true);
// var_dump($b);
// var_dump($b);
$url = "https://yyfsvxm.postar.cn/yyfsevr/order/account";
$res = $this->curl_post($url,$b);
// print_r("<pre>");
// var_dump($res);
if($res['code'] == "000000"){
$dat['state'] = 1;
$dat['taskCreateDate'] = $res['data']['taskCreateDate'];
@ -276,8 +295,6 @@ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlu5coHWBbtrz8DyX0VbPWiJZlAsofwZ99pZq
// 参与消费返补
$billions = new Billions();
$order['order_amount'] = round($gtpay_msg['txamt']/100,2);
$this->playAudio($post['lid'], $order['order_amount']);
$order['id'] = $gtpay_msg['id'];
$order['order_sn'] = $gtpay_msg['orderNo'];
$order['type'] = 4;
@ -397,23 +414,4 @@ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlu5coHWBbtrz8DyX0VbPWiJZlAsofwZ99pZq
$tmpInfo=json_decode($output,true);
return $tmpInfo;
}
private function playAudio($lstore_id, $money) {
if (!$lstore_id && !$money) {
return;
}
$sound = LocalStoreCloudAudio::where('lstore_id', $lstore_id)->field('sn, version, message')->find();
if (!$sound) {
return;
}
$message = empty($sound['message'])? CloudAudioServer::MESSAGE : $sound['message'] ;
CloudAudioServer::send([
'id' => $sound['sn'],
'version' => $sound['version'],
'message' => "{$message},{$money},元",
]);
}
}