Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zptz-sass-kelaidian
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
李大见
zptz-sass-kelaidian
Commits
f097e136
提交
f097e136
authored
9月 20, 2024
作者:
李大见
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
定时扣费,查询经销商,供货价维护
上级
c956cc5c
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
140 行增加
和
6 行删除
+140
-6
DeductionFee.php
app/Console/Commands/DeductionFee.php
+93
-0
Kernel.php
app/Console/Kernel.php
+2
-0
CommonController.php
app/Http/Controllers/Common/CommonController.php
+37
-2
PayController.php
app/Http/Controllers/Service/PayController.php
+3
-2
SupplierPriceController.php
app/Http/Controllers/Service/SupplierPriceController.php
+2
-1
SupplierPriceService.php
app/Services/SupplierPriceService.php
+3
-1
没有找到文件。
app/Console/Commands/DeductionFee.php
0 → 100644
浏览文件 @
f097e136
<?php
namespace
App\Console\Commands
;
use
Illuminate\Console\Command
;
use
DB
;
class
DeductionFee
extends
Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected
$signature
=
'DeductionFee'
;
/**
* The console command description.
*
* @var string
*/
protected
$description
=
'Command DeductionFee'
;
/**
* Create a new command instance.
*
* @return void
*/
public
function
__construct
()
{
parent
::
__construct
();
}
/**
* Execute the console command.
*
* @return mixed
*/
public
function
handle
()
{
$find_data
=
DB
::
table
(
'admin'
)
->
groupBy
(
'company_id'
)
->
get
();
foreach
(
$find_data
as
$key
=>
$value
)
{
$find_balance
=
DB
::
table
(
'admin_recharge'
)
->
where
(
'adre_company_id'
,
$value
[
'company_id'
])
->
first
();
if
(
empty
(
$find_balance
))
{
$add_data
[
'adre_company_id'
]
=
$value
[
'company_id'
];
$add_data
[
'adre_banlance'
]
=
-
100
;
$add_data
[
'adre_first_monthFee'
]
=
date
(
'Y-m-d H:i:s'
);
$add_data
[
'adre_next_monthFee'
]
=
date
(
'Y-m-d H:i:s'
,
strtotime
(
'+1 month'
));
$add_res
=
DB
::
table
(
'admin_recharge'
)
->
insertGetId
(
$add_data
);
}
else
{
if
(
empty
(
$find_balance
[
'adre_next_monthFee'
]))
{
$update
[
'adre_banlance'
]
=
$find_balance
[
'adre_banlance'
]
-
100
;
$update
[
'adre_first_monthFee'
]
=
date
(
'Y-m-d H:i:s'
);
$update
[
'adre_next_monthFee'
]
=
date
(
'Y-m-d H:i:s'
,
strtotime
(
'+1 month'
));
$update_res
=
DB
::
table
(
'admin_recharge'
)
->
where
(
'adre_id'
,
$find_balance
[
'adre_id'
])
->
update
(
$update
);
}
else
{
if
(
time
()
>=
strtotime
(
$find_balance
[
'adre_next_monthFee'
]))
{
$update
[
'adre_banlance'
]
=
$find_balance
[
'adre_banlance'
]
-
100
;
$update
[
'adre_next_monthFee'
]
=
date
(
'Y-m-d H:i:s'
,
strtotime
(
$find_balance
[
'adre_next_monthFee'
],
'+1 month'
));
$update_res
=
DB
::
table
(
'admin_recharge'
)
->
where
(
'adre_id'
,
$find_balance
[
'adre_id'
])
->
update
(
$update
);
}
}
}
$order_number
=
'YF'
.
date
(
'YmdHis'
)
.
rand
(
1000
,
9999
);
$recharge_order
[
'reo_adm_id'
]
=
$value
[
'id'
];
$recharge_order
[
'reo_company_id'
]
=
$value
[
'company_id'
];
$recharge_order
[
'reo_order_number'
]
=
$order_number
;
$recharge_order
[
'reo_price'
]
=
-
100
;
$recharge_order
[
'reo_pay_state'
]
=
1
;
$recharge_order
[
'reo_state'
]
=
1
;
$recharge_order
[
'reo_type'
]
=
3
;
//扣月费
if
(
$value
[
'admin_groupnew'
]
==
2
)
{
$recharge_order
[
'reo_client_type'
]
=
1
;
}
elseif
(
$value
[
'admin_groupnew'
]
==
3
)
{
$recharge_order
[
'reo_client_type'
]
=
2
;
}
else
{
$recharge_order
[
'reo_client_type'
]
=
3
;
}
$recharge_order
[
'reo_pay_way'
]
=
1
;
$recharge_order
[
'reo_create_time'
]
=
date
(
'Y-m-d H:i:s'
);
$recharge_order
[
'reo_pay_time'
]
=
date
(
'Y-m-d H:i:s'
);
$add_res
=
DB
::
table
(
'recharge_order'
)
->
insertGetId
(
$recharge_order
);
}
}
}
app/Console/Kernel.php
浏览文件 @
f097e136
...
...
@@ -18,6 +18,7 @@ class Kernel extends ConsoleKernel
Commands\GetJdSelfOrder
::
class
,
Commands\GetJdSelfRefund
::
class
,
Commands\GetJdSelfShhOrder
::
class
Commands\DeductionFee
::
class
];
/**
...
...
@@ -35,6 +36,7 @@ class Kernel extends ConsoleKernel
$schedule
->
command
(
'getJdSelfOrder'
)
->
everyFiveMinutes
();
//每五分钟执行一次
$schedule
->
command
(
'getJdSelfRefund'
)
->
everyFiveMinutes
();
//每五分钟执行一次
$schedule
->
command
(
'GetJdSelfShhOrder'
)
->
everyFiveMinutes
();
//每五分钟执行一次
$schedule
->
command
(
'DeductionFee'
)
->
everyFiveMinutes
();
//每五分钟执行一次
}
/**
...
...
app/Http/Controllers/Common/CommonController.php
浏览文件 @
f097e136
...
...
@@ -370,7 +370,7 @@ class CommonController extends BaseController
$com_parent_id
=
array_filter
(
$com_parent_id
,
function
(
$value
)
{
return
$value
!=
1
;
// 这里可以修改条件来移除不同的值
});
// 重置数组键名
// 重置数组键名
$com_parent_id
=
array_values
(
$com_parent_id
);
}
$parameter
[
'company_id_searchin'
]
=
$com_parent_id
;
...
...
@@ -384,7 +384,6 @@ class CommonController extends BaseController
unset
(
$parameter
[
'token'
]);
unset
(
$parameter
[
'Login_id'
]);
unset
(
$parameter
[
'Pri_id'
]);
// $parameter['enable'] = 1;
switch
(
$type
)
{
case
1
:
...
...
@@ -1264,4 +1263,40 @@ class CommonController extends BaseController
}
/**
* 获取公司
* @authors ldj
* @email 909490343@qq.com
* @date 2024-09-20
* @param Request $request [description]
* @return [type] [description]
*/
public
function
getCompany
(
Request
$request
){
$session
=
$request
->
get
(
'session_token'
);
$data
=
new
Company
();
$data
=
$data
->
where
(
'com_type'
,
1
)
->
where
(
'id'
,
'!='
,
1
)
->
select
(
'com_id'
,
'com_name'
)
->
get
()
->
toarray
();
return
$this
->
success
(
'获取成功'
,
$data
);
}
/**
* 查询经销商
* @authors ldj
* @email 909490343@qq.com
* @date 2024-09-20
* @param Request $request [description]
* @return [type] [description]
*/
public
function
getDistributor
(
Request
$request
)
{
$list
=
DB
::
table
(
'admin'
)
->
where
(
'admin_groupnew'
,
3
)
->
select
(
'id'
,
'admin_acc'
,
'admin_name'
)
->
get
()
->
toarray
();
if
(
$list
){
return
$this
->
success
(
'操作成功'
,
$list
);
}
else
{
return
$this
->
error
(
'无数据'
,
ErrorInc
::
DATA_EMPTY
,
[]);
}
}
}
app/Http/Controllers/Service/PayController.php
浏览文件 @
f097e136
...
...
@@ -112,8 +112,9 @@ class PayController extends BaseController
}
elseif
(
$v
[
'reo_type'
]
==
2
){
$list
[
$k
][
'reo_type_name'
]
=
"扣费"
;
$list
[
$k
][
'reo_pay_way_name'
]
=
"派单扣费"
;
}
else
{
$list
[
$k
][
'reo_type_name'
]
=
"--"
;
}
elseif
(
$v
[
'reo_type'
]
==
3
)
{
$list
[
$k
][
'reo_type_name'
]
=
"扣费"
;
$list
[
$k
][
'reo_pay_way_name'
]
=
"月费扣费"
;
}
if
(
$v
[
'reo_pay_state'
]
==
1
){
...
...
app/Http/Controllers/Service/SupplierPriceController.php
浏览文件 @
f097e136
...
...
@@ -98,7 +98,8 @@ public function index(Request $request)
$priId
=
$request
->
input
(
'Pri_id'
);
$data
=
$this
->
dataService
->
formatPageContent
(
$token
,
$priId
,
$data
);
}
$data
[
'service_type'
][]
=
[
'type'
=>
1
,
'name'
=>
'自营'
];
$data
[
'service_type'
][]
=
[
'type'
=>
2
,
'name'
=>
'平台'
];
if
(
!
empty
(
$data
[
'list'
]))
{
return
$this
->
success
(
'获取成功'
,
$data
);
...
...
app/Services/SupplierPriceService.php
浏览文件 @
f097e136
...
...
@@ -72,7 +72,9 @@ class SupplierPriceService extends Service
$time
=
date
(
'Y-m-d H:i:s'
,
strtotime
(
$param
[
'end_time'
]));
$Db
=
$Db
->
where
(
"create_time"
,
'<='
,
$time
);
}
if
(
!
empty
(
$param
[
'type'
]))
{
//结束时间
$Db
=
$Db
->
where
(
"type"
,
$param
[
'type'
]);
}
if
(
$session
[
'admin_groupnew'
]
!=
7
){
//管理员可以看全部 && $session['admin_groupnew'] != 8
$Db
=
$Db
->
where
(
"gh_price.company_id"
,
$session
[
'company_id'
]);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论