Merge pull request 'dev' (#10) from dev into preview

Reviewed-on: #10
This commit is contained in:
mkm 2023-09-24 21:31:01 +08:00
commit bd377e979e
483 changed files with 317 additions and 361 deletions

View File

@ -139,7 +139,7 @@ class ServeOrderRepository extends BaseRepository
$res = $this->{$type}($merId, $data);
$key = $res['key'];
$param = $res['param'];
if(!$result = Cache::store('file')->get($key)){
$order_sn = app()->make(StoreOrderRepository::class)->getNewOrderId('cs');
$param['order_sn'] = $order_sn;

View File

@ -48,6 +48,10 @@ use think\facade\Log;
use think\facade\Queue;
use crmeb\jobs\SendSmsJob;
use crmeb\jobs\TestJob;
use crmeb\services\PayService;
use crmeb\services\CombinePayService;
use app\common\model\user\User;
use app\controller\api\Ceshi;
/**
@ -60,8 +64,22 @@ class Auth extends BaseController
{
public function dotest()
{
Queue::push(SendSmsJob::class, ['tempId' => 'ORDER_CREATE', 'id' => 101]);
return app('json')->success();
$repository = app()->make(StoreOrderRepository::class);
$param = [
"status" => 0,
"is_del" => 0,
"mer_id" => 1,
"pay_type" => 1,
"attach" => "margin",
"order_info" => '{"is_margin":1,"margin":"0.01"}',
"pay_price" => 0.01,
"order_sn" => "bzj" . date('YmdHis') . uniqid(),
"body" =>'哈哈哈',
];
$payType = 'weixinApp';
$service = new PayService($payType, $param);
$payInfo = $service->pay(User::where(['uid'=>1])->find());
return app('json')->success([]);
}
public function test()
@ -210,7 +228,7 @@ class Auth extends BaseController
$store_service = Db::name('store_service')->where('uid', $data['uid'])->find();
if ($store_service) {
$mer_arr = Db::name('merchant')->where('mer_id', $store_service['mer_id'])->where('is_del', 0)->field('type_id,mer_avatar,mer_banner,business_status,mer_info,category_id,service_phone,mer_address,uid,mer_name,create_time,update_time,mer_settlement_agree_status')->find();
$mer_arr = Db::name('merchant')->where('mer_id', $store_service['mer_id'])->where('is_del', 0)->field('type_id,mer_avatar,mer_banner,business_status,mer_info,category_id,service_phone,mer_address,uid,mer_name,create_time,update_time,mer_settlement_agree_status,is_margin')->find();
if ($mer_arr && $mer_arr['mer_avatar'] != '' && $mer_arr['mer_banner'] != '' && $mer_arr['mer_info'] && $mer_arr['service_phone'] != '' && $mer_arr['mer_address'] != '') {
$data['is_wsxx'] = 1;
}
@ -255,6 +273,40 @@ class Auth extends BaseController
return app('json')->success('退出登录');
}
public function doMargin()
{
$user = $this->request->userInfo();
$merchant = Db::name('merchant')->where('uid', $user['uid'])->where('status', 1)->where('is_margin', 1)->find();
if (!$merchant) {
return app('json')->fail('用户店铺异常');
}
$repository = app()->make(StoreOrderRepository::class);
$orderSn = "bzj" . date('YmdHis') . uniqid();
Db::name('margin_order')->insert([
'uid' => $user['uid'],
'mer_id' => $merchant['mer_id'],
'order_sn' => $orderSn,
'total_price' => $merchant['margin'],
'pay_type' => 1,
'create_time' => date('Y-m-d H:i:s')
]);
$param = [
"status" => 0,
"is_del" => 0,
"mer_id" => $merchant['mer_id'],
"pay_type" => 1,
"attach" => "margin",
"order_info" => '{"is_margin":1,"margin":"' . $merchant['margin'] . '"}',
"pay_price" => $merchant['margin'],
"order_sn" => $orderSn,
"body" => $merchant['mer_name'] . ' - ' . $merchant['margin'],
];
$payType = 'weixinApp';
$service = new PayService($payType, $param);
$payInfo = $service->pay(User::where(['uid'=>$user['uid']])->find());
return app('json')->success($payInfo);
}
/**
* @return mixed
* @throws DataNotFoundException

View File

@ -253,6 +253,21 @@ class Merchant extends BaseController
return app('json')->success($data);
}
/**
* @return mixed
* @author xaboy
* @day 2020/7/21
*/
public function marginInfo(MerchantTakeRepository $repository)
{
$id = $this->request->param('id');
if(empty($id)){
return app('json')->fail('参数错误');
}
$data = Db::name('merchant')->where('mer_id',$id)->field('uid,mer_id,mer_name,margin,is_margin')->find();
return app('json')->success($data);
}
public function apply($merId){
$merchant = app()->make(MerchantRepository::class)->search(['mer_id' => $merId])->field('uid,mer_id,mer_name,mer_money,financial_bank,financial_wechat,financial_alipay,financial_type')->find();
if (($msg = $this->checkAuth($merchant)) !== true) {

View File

@ -96,9 +96,9 @@ class MerchantIntention extends BaseController
];
$postUrl = env('TASK_WORKER_HOST_URL') . '/adminapi/company/createShopMerchant';
$res = $this->sendMerIntentionApply($sendData, $postUrl);
if (!$res) {
if (!$res['ok']) {
Db::name('merchant_intention')->where('mer_intention_id', $intention->mer_intention_id)->delete();
throw new ValidateException('申请商户入驻失败,请联系平台');
throw new ValidateException('申请商户入驻失败,' . $res['msg']);
}
return app('json')->success('提交成功');
}
@ -195,9 +195,9 @@ class MerchantIntention extends BaseController
];
$postUrl = env('TASK_WORKER_HOST_URL') . '/adminapi/company/createShopMerchant';
$res = $this->sendMerIntentionApply($sendData, $postUrl);
if (!$res) {
if (!$res['ok']) {
Db::name('merchant_integntion')->where('mer_intention_id', $intentionId)->delete();
throw new ValidateException('商户交易申请失败,请联系平台');
throw new ValidateException('商户交易申请失败,' . $res['msg']);
}
Db::name('merchant')->where('uid', $this->userInfo->uid)->where('status', 1)->update(['business_status'=>1]);
return app('json')->success('申请成功');
@ -216,15 +216,20 @@ class MerchantIntention extends BaseController
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$resData = curl_exec($ch);
curl_close($ch);
$ok = false;
$rtnData = [
'ok' => false,
'msg' => ''
];
if (!empty($resData) && is_string($resData)) {
Log::info("商户申请反馈信息" . $resData);
$resInfo = json_decode($resData, true);
if(!empty($resInfo['code']) && $resInfo['code'] == 1){
$ok = true;
$rtnData['ok'] = true;
} else {
$rtnData['msg'] = $resInfo['msg'];
}
}
return $ok;
return $rtnData;
}
public function update($id)
@ -284,8 +289,8 @@ class MerchantIntention extends BaseController
];
$postUrl = env('TASK_WORKER_HOST_URL') . '/adminapi/company/createShopMerchant';
$res = $this->sendMerIntentionApply($sendData, $postUrl);
if (!$res) {
throw new ValidateException('申请商户入驻失败,请联系平台');
if (!$res['ok']) {
throw new ValidateException('申请商户入驻失败,' . $res['msg']);
}
return app('json')->success('修改成功');
}

View File

@ -66,6 +66,7 @@ return [
'pay_success_meal' => [\crmeb\listens\pay\MealSuccessListen::class],
// 'community_address'=>[\app\listener\CommunityAddress::class],
'order.paySuccessOrder'=>[\app\listener\paySuccessOrder::class],
'pay_success_margin'=>[\app\listener\paySuccessMargin::class],
'order.sendGoodsCode'=>[\app\listener\SendGoodsCode::class],
'product.create'=>[\app\listener\ProductCreate::class],
'product.delivery'=>[\app\listener\DeliveryGoods::class],

View File

@ -0,0 +1,30 @@
<?php
declare (strict_types=1);
namespace app\listener;
use crmeb\utils\DingTalk;
use think\facade\Db;
use think\facade\Log;
class paySuccessMargin
{
public $event;
public function handle($event)
{
Log::info('微信支付保证金成功回调' . json_encode($event));
$this->event = $event;
$order_sn = $event['order_sn'] ?? '';
$marginInfo = Db::name('margin_order')->where('order_sn', $order_sn)->find();
Db::name('margin_order')->where('order_sn', $order_sn)->update([
'paid' => 1,
'pay_time' => date('Y-m-d H:i:s')
]);
Db::name('merchant')->where('mer_id', $marginInfo['mer_id'] ?? 0)->where('uid', $marginInfo['uid'] ?? 0)->update([
'is_margin' => 10
]);
}
}

View File

@ -2,4 +2,4 @@
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')
if(window.location.protocol == 'https:'){
document.write('<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">')
}</script><link rel=stylesheet href=/static/index.97465e7b.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.958c16a8.js></script><script src=/static/js/index.c32f4764.js></script></body></html>
}</script><link rel=stylesheet href=/static/index.97465e7b.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.958c16a8.js></script><script src=/static/js/index.01e237b9.js></script></body></html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 942 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-activity-combination_details-index"],{aa6c:function(i,n,o){"use strict";o.r(n);var a=o("f0c5"),t=Object(a["a"])({},void 0,void 0,!1,null,null,null,!1,void 0,void 0);n["default"]=t.exports}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-annex-web_view-index"],{"2a6d":function(t,n,e){"use strict";e.r(n);var i=e("e09f"),r=e("ca75");for(var u in r)["default"].indexOf(u)<0&&function(t){e.d(n,t,(function(){return r[t]}))}(u);var o=e("f0c5"),a=Object(o["a"])(r["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],void 0);n["default"]=a.exports},ca75:function(t,n,e){"use strict";e.r(n);var i=e("d044"),r=e.n(i);for(var u in i)["default"].indexOf(u)<0&&function(t){e.d(n,t,(function(){return i[t]}))}(u);n["default"]=r.a},d044:function(t,n,e){"use strict";e("7a82"),Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i={data:function(){return{windowH:0,windowW:0,webviewStyles:{progress:{color:"transparent"}},url:""}},onLoad:function(t){this.url=decodeURIComponent(t.url);try{var n=uni.getSystemInfoSync();this.windowW=n.windowWidth,this.windowH=n.windowHeight}catch(e){}}};n.default=i},e09f:function(t,n,e){"use strict";e.d(n,"b",(function(){return i})),e.d(n,"c",(function(){return r})),e.d(n,"a",(function(){}));var i=function(){var t=this.$createElement,n=this._self._c||t;return n("v-uni-web-view",{staticClass:"web-view",style:{width:this.windowW+"px",height:this.windowH+"px"},attrs:{"webview-styles":this.webviewStyles,src:this.url}})},r=[]}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More