Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
service
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
aimeiyue
service
Commits
6796a728
Commit
6796a728
authored
Jan 09, 2025
by
lizhilin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
0bdef142
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
105 additions
and
22 deletions
+105
-22
app/Admin/Controllers/HfCompanyMemberController.php
+13
-12
app/Admin/Controllers/OrderInfoController.php
+11
-9
app/Helper/functions.php
+22
-0
app/Http/Controllers/Api/OrderController.php
+59
-1
No files found.
app/Admin/Controllers/HfCompanyMemberController.php
View file @
6796a728
...
@@ -67,17 +67,12 @@ protected function grid()
...
@@ -67,17 +67,12 @@ protected function grid()
}
}
return
$str
;
return
$str
;
});
});
// $grid->column('legal_cert_type');
// $grid->column('legal_cert_id');
// $grid->column('legal_person');
// $grid->column('legal_cert_id_begin');
// $grid->column('legal_cert_id_expires');
// $grid->column('legal_mp');
//$grid->column('attach_file');
// $grid->column('created_at');
// $grid->column('updated_at')->sortable();
$grid
->
disableViewButton
();
$grid
->
disableViewButton
();
$grid
->
disableEditButton
();
$grid
->
disableDeleteButton
();
$grid
->
disableActions
();
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
// 更改为 panel 布局
// 更改为 panel 布局
...
@@ -161,7 +156,8 @@ protected function form()
...
@@ -161,7 +156,8 @@ protected function form()
->
autoUpload
()
->
autoUpload
()
->
required
()
->
required
()
->
help
(
'内容须包含三证合一证件照、法人身份证正面照、法人身份证反面照、开户银行许可证照。 压缩 zip包后上传,最大限制为 9 M'
);
//hf
->
help
(
'内容须包含三证合一证件照、法人身份证正面照、法人身份证反面照、开户银行许可证照。 压缩 zip包后上传,最大限制为 9 M'
);
//hf
$form
->
text
(
'card_no'
,
'银行卡号'
)
->
required
();
$form
->
text
(
'card_name'
,
'银行卡对应的户名'
)
->
required
();
$form
->
disableCreatingCheck
();
$form
->
disableCreatingCheck
();
$form
->
disableEditingCheck
();
$form
->
disableEditingCheck
();
...
@@ -187,10 +183,11 @@ function (Form $form, $result) {
...
@@ -187,10 +183,11 @@ function (Form $form, $result) {
"order_no"
=>
$params
[
'order_no'
],
"order_no"
=>
$params
[
'order_no'
],
# 企业名称
# 企业名称
"name"
=>
$params
[
'name'
],
"name"
=>
$params
[
'name'
],
'prod_mode'
=>
false
,
# 省份
# 省份
"prov_code"
=>
"0031"
,
"prov_code"
=>
$params
[
'prov_code'
]
,
# 地区
# 地区
"area_code"
=>
"3100"
,
"area_code"
=>
$params
[
'area_code'
]
,
# 统一社会信用码
# 统一社会信用码
"social_credit_code"
=>
$params
[
'social_credit_code'
],
"social_credit_code"
=>
$params
[
'social_credit_code'
],
"social_credit_code_expires"
=>
$params
[
'social_credit_code_expires'
],
"social_credit_code_expires"
=>
$params
[
'social_credit_code_expires'
],
...
@@ -216,6 +213,10 @@ function (Form $form, $result) {
...
@@ -216,6 +213,10 @@ function (Form $form, $result) {
"email"
=>
$params
[
'email'
],
"email"
=>
$params
[
'email'
],
# 上传附件
# 上传附件
"attach_file"
=>
new
\CURLFile
(
$params
[
'attach_file'
]),
"attach_file"
=>
new
\CURLFile
(
$params
[
'attach_file'
]),
# 银行卡号
"card_no"
=>
$params
[
'card_no'
],
//如果需要自动开结算账户,本字段必填
# 银行卡对应的户名
"card_name"
=>
$params
[
'card_name'
],
//如果需要自动开结算账户,本字段必填
);
);
$result
=
(
new
Adapay
())
->
createCompany
(
$member_params
);
$result
=
(
new
Adapay
())
->
createCompany
(
$member_params
);
...
...
app/Admin/Controllers/OrderInfoController.php
View file @
6796a728
...
@@ -116,16 +116,18 @@ protected function grid()
...
@@ -116,16 +116,18 @@ protected function grid()
$modal
->
icon
(
'feather icon-edit'
);
$modal
->
icon
(
'feather icon-edit'
);
// 传递当前行字段值
// 传递当前行字段值
return
VerifierCodeForm
::
make
()
->
payload
([
'id'
=>
$this
->
id
]);
return
VerifierCodeForm
::
make
()
->
payload
([
'id'
=>
$this
->
id
]);
})
->
if
(
function
(
$column
)
{
return
(
$column
->
getValue
()
==
3
&&
$this
->
shipping_type
==
0
);
})
->
display
(
'点击发货'
)
->
modal
(
function
(
Grid\Displayers\Modal
$modal
)
{
// 标题
$modal
->
title
(
'发货'
);
// 自定义图标
$modal
->
icon
(
'feather icon-edit'
);
// 传递当前行字段值
return
ShippingForm
::
make
()
->
payload
([
'id'
=>
$this
->
id
]);
});
});
//下单送货上门、门店自提均需要核销码用户确认,无需后台接入发货管理(放在核销员端)
// ->if(function ($column) {
// return ($column->getValue() == 3 && $this->shipping_type == 0);
// })->display('点击发货')->modal(function (Grid\Displayers\Modal $modal) {
// // 标题
// $modal->title('发货');
// // 自定义图标
// $modal->icon('feather icon-edit');
// // 传递当前行字段值
// return ShippingForm::make()->payload(['id' => $this->id]);
// })
$grid
->
column
(
'verification_code'
,
'核销码'
)
->
limit
(
10
);
$grid
->
column
(
'verification_code'
,
'核销码'
)
->
limit
(
10
);
$grid
->
column
(
'verifier'
,
'核销信息'
)
->
if
(
function
(
$column
)
{
$grid
->
column
(
'verifier'
,
'核销信息'
)
->
if
(
function
(
$column
)
{
return
$column
->
getValue
();
return
$column
->
getValue
();
...
...
app/Helper/functions.php
View file @
6796a728
...
@@ -42,3 +42,25 @@ function togetherFilePath($path = '')
...
@@ -42,3 +42,25 @@ function togetherFilePath($path = '')
}
}
return
$path
;
return
$path
;
}
}
function
curl_post_request
(
$url
,
$data
)
{
$headers
=
array
(
"Content-type: application/json;charset=UTF-8"
);
$curl
=
curl_init
();
curl_setopt
(
$curl
,
CURLOPT_URL
,
$url
);
curl_setopt
(
$curl
,
CURLOPT_POST
,
true
);
curl_setopt
(
$curl
,
CURLOPT_RETURNTRANSFER
,
true
);
curl_setopt
(
$curl
,
CURLOPT_SSL_VERIFYPEER
,
FALSE
);
curl_setopt
(
$curl
,
CURLOPT_SSL_VERIFYHOST
,
FALSE
);
// 设置HTTP头部
curl_setopt
(
$curl
,
CURLOPT_HTTPHEADER
,
$headers
);
curl_setopt
(
$curl
,
CURLOPT_POSTFIELDS
,
json_encode
(
$data
,
JSON_UNESCAPED_UNICODE
));
$response
=
curl_exec
(
$curl
);
$result
=
json_decode
(
$response
,
true
);
// 关闭cURL会话
curl_close
(
$curl
);
return
$result
;
}
app/Http/Controllers/Api/OrderController.php
View file @
6796a728
...
@@ -7,6 +7,8 @@
...
@@ -7,6 +7,8 @@
use
App\Models\UserAddress
;
use
App\Models\UserAddress
;
use
App\Models\Store
;
use
App\Models\Store
;
use
App\Models\Good
as
GoodModel
;
use
App\Models\Good
as
GoodModel
;
use
App\Models\User
as
UserModel
;
use
App\Models\PaymentRecord
;
use
App\Models\GoodSku
;
use
App\Models\GoodSku
;
use
App\Models\OrderGoods
;
use
App\Models\OrderGoods
;
use
App\Models\OrderInfo
as
OrderInfoModel
;
use
App\Models\OrderInfo
as
OrderInfoModel
;
...
@@ -15,6 +17,10 @@
...
@@ -15,6 +17,10 @@
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Support\Facades\DB
;
use
League\CommonMark\Node\Query\OrExpr
;
use
League\CommonMark\Node\Query\OrExpr
;
use
App\Handlers\MpAaccessToken
;
use
DateTime
;
use
DateTimeZone
;
use
Exception
;
class
OrderController
extends
BaseController
class
OrderController
extends
BaseController
{
{
...
@@ -477,19 +483,71 @@ public function delOrder(Request $request)
...
@@ -477,19 +483,71 @@ public function delOrder(Request $request)
//扫码核销
//扫码核销
public
function
scanCodeVerifi
(
Request
$request
)
public
function
scanCodeVerifi
(
Request
$request
)
{
{
$mpTokenObj
=
new
MpAaccessToken
();
$dateTime
=
new
DateTime
();
$dateTime
->
setTimezone
(
new
DateTimeZone
(
'Asia/Shanghai'
));
$upload_time
=
$dateTime
->
format
(
'Y-m-d\TH:i:s.vP'
);
$verObj
=
$request
->
user
();
$verObj
=
$request
->
user
();
$code
=
$request
->
code
??
''
;
$code
=
$request
->
code
??
''
;
$orderObj
=
OrderInfoModel
::
where
(
'verification_code'
,
$code
)
->
first
();
$orderObj
=
OrderInfoModel
::
where
(
'verification_code'
,
$code
)
->
first
();
if
(
!
$orderObj
)
{
if
(
!
$orderObj
)
{
return
$this
->
JsonResponse
(
''
,
'参数错误'
,
201
);
return
$this
->
JsonResponse
(
''
,
'参数错误'
,
201
);
}
}
Log
::
add
(
'核销操作5'
,
[
$orderObj
->
verification_at
]);
Log
::
add
(
'核销操作5'
,
[
$orderObj
->
verification_at
]);
if
(
!
$orderObj
->
verification_at
)
{
if
(
!
$orderObj
->
verification_at
)
{
$orderObj
->
order_status
=
3
;
$orderObj
->
order_status
=
3
;
$orderObj
->
verifier_id
=
$verObj
->
id
;
$orderObj
->
verifier_id
=
$verObj
->
id
;
$orderObj
->
verifier
=
$verObj
->
name
;
$orderObj
->
verifier
=
$verObj
->
name
;
$orderObj
->
verification_at
=
date
(
"Y-m-d H:i:s"
);
$orderObj
->
verification_at
=
date
(
"Y-m-d H:i:s"
);
$orderObj
->
save
();
//$orderObj->save();
try
{
//接入微信小程序发货管理
//付款记录
$recordObj
=
PaymentRecord
::
where
(
'order_sn'
,
$orderObj
->
order_sn
)
->
first
();
$transaction_id
=
$recordObj
->
other_order
;
$payerOpenid
=
UserModel
::
where
(
'id'
,
$recordObj
->
uid
)
->
value
(
'openid'
);
if
(
!
$transaction_id
)
{
throw
new
Exception
(
'该订单尚未支付'
);
}
//商品信息
$ogItem
=
DB
::
table
(
'li_order_goods'
)
->
select
(
DB
::
raw
(
'GROUP_CONCAT(goods_name) as shipping_goods'
))
->
where
(
'order_id'
,
$orderObj
->
id
)
->
first
();
$access_token
=
$mpTokenObj
->
getAccessToken
();
$url
=
"https://api.weixin.qq.com/wxa/sec/order/upload_shipping_info?access_token="
.
$access_token
;
$data
=
[
"order_key"
=>
[
"order_number_type"
=>
2
,
"transaction_id"
=>
$transaction_id
,
],
"logistics_type"
=>
4
,
//4、用户自提
"delivery_mode"
=>
1
,
//1、(统一发货)
"shipping_list"
=>
[
[
"item_desc"
=>
$ogItem
->
shipping_goods
]
],
"upload_time"
=>
$upload_time
,
"payer"
=>
[
"openid"
=>
$payerOpenid
,
]
];
$result
=
curl_post_request
(
$url
,
$data
);
Log
::
add
(
'发货录入'
,
$result
);
if
(
$result
[
'errcode'
]
!=
0
)
{
throw
new
Exception
(
$result
[
'errmsg'
]);
}
else
{
$orderObj
->
save
();
}
DB
::
commit
();
}
catch
(
\Exception
$e
)
{
DB
::
rollBack
();
return
$this
->
JsonResponse
(
''
,
$e
->
getMessage
(),
500
);
}
}
else
{
}
else
{
return
$this
->
JsonResponse
(
''
,
'该码已核销,无需多次重复扫码'
,
500
);
return
$this
->
JsonResponse
(
''
,
'该码已核销,无需多次重复扫码'
,
500
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment