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
0844224e
Commit
0844224e
authored
Sep 30, 2024
by
lizhilin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
ca26f33f
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
105 additions
and
44 deletions
+105
-44
app/Admin/Controllers/MerchantGoodsStoreController.php
+1
-0
app/Admin/Renderable/MerchantStoreSkuList.php
+2
-2
app/Store/Controllers/OrderDivideRecordController.php
+85
-0
app/Store/Controllers/StoreIncomeController.php
+0
-40
app/Store/routes.php
+2
-0
lang/zh_CN/order-divide-record.php
+13
-0
lang/zh_CN/store-income.php
+2
-2
No files found.
app/Admin/Controllers/MerchantGoodsStoreController.php
View file @
0844224e
...
...
@@ -31,6 +31,7 @@ class MerchantGoodsStoreController extends AdminController
protected
function
grid
()
{
return
Grid
::
make
(
MerchantStore
::
with
([
'goods'
,
'merchant'
]),
function
(
Grid
$grid
)
{
$grid
->
model
()
->
orderBy
(
'created_at'
,
'DESC'
);
$grid
->
column
(
'id'
)
->
sortable
();
$grid
->
column
(
'goods_sn'
,
'商品编号'
);
$grid
->
column
(
'goods.goods_name'
,
'商品名称'
);
...
...
app/Admin/Renderable/MerchantStoreSkuList.php
View file @
0844224e
...
...
@@ -15,9 +15,9 @@ public function grid(): Grid
{
// 获取外部传递的参数
$mgs_id
=
$this
->
payload
[
'mgs_id'
]
??
[]
;
$mgs_id
=
$this
->
payload
[
'mgs_id'
]
??
0
;
return
Grid
::
make
(
MerchantGoodSku
::
with
([
'attr'
]),
function
(
Grid
$grid
)
use
(
$mgs_id
)
{
return
Grid
::
make
(
MerchantGoodSku
::
with
([
'attr'
]),
function
(
Grid
$grid
)
use
(
$mgs_id
,
$merid
)
{
$grid
->
addTableClass
([
'table-text-center'
]);
$grid
->
model
()
->
where
(
'mgs_id'
,
$mgs_id
);
...
...
app/Store/Controllers/OrderDivideRecordController.php
0 → 100644
View file @
0844224e
<?php
namespace
App\Store\Controllers
;
use
App\Models\Merchant
;
use
App\Models\OrderDivideRecord
;
use
App\Store\Actions\Grid\IncomeApply
;
use
Dcat\Admin\Admin
;
use
Dcat\Admin\Form
;
use
Dcat\Admin\Grid
;
use
Dcat\Admin\Show
;
use
Dcat\Admin\Http\Controllers\AdminController
;
use
Dcat\Admin\Widgets\Card
;
use
Dcat\Admin\Layout\Content
;
use
Dcat\Admin\Widgets\Box
;
class
OrderDivideRecordController
extends
AdminController
{
// public function index(Content $content)
// {
// return $content->header('自定义表单')->body($this->grid());
// }
/**
* Make a grid builder.
*
* @return Grid
*/
protected
function
grid
()
{
return
Grid
::
make
(
new
OrderDivideRecord
(),
function
(
Grid
$grid
)
{
$merchant_id
=
Admin
::
user
()
->
merchant_id
;
$total_revenue
=
$balance
=
$cashout
=
0
;
if
(
$merchant_id
)
{
$merObj
=
Merchant
::
where
(
'id'
,
$merchant_id
)
->
first
();
$total_revenue
=
$merObj
->
total_revenue
??
0
;
$balance
=
$merObj
->
balance
??
0
;
$cashout
=
$total_revenue
-
$balance
;
}
$grid
->
header
(
function
()
use
(
$total_revenue
,
$balance
,
$cashout
)
{
$box
=
new
Box
(
'统计信息'
,
'这里可以放置统计数据'
);
// 自定义统计框样式
$box
->
style
(
'info'
);
// 可选的样式:primary, info, warning, danger, success, default
$content
=
'<div style="height: 135px;display: flex;align-items: center;text-align: center;">
<div style="flex: 1;display: flex;flex-direction: column;border-right: 1px solid #b9c3cd;">
<h2 style="font-size: 25px;margin-top: 25px;">总金额(元)</h2>
<p style="color: orange;font-size: 45px;font-weight: bold;">'
.
$total_revenue
.
'</p>
</div>
<div style="flex: 1;display: flex;flex-direction: column;border-right: 1px solid #b9c3cd;">
<h2 style="font-size: 25px;margin-top: 25px;">已提现金额(元)</h2><p style="color:#21b978;font-size: 45px;font-weight: bold;">'
.
$cashout
.
'</p>
</div>
<div style="flex: 1;display: flex;flex-direction: column;">
<h2 style="font-size: 25px;margin-top: 25px;">总余额(元)</h2><p style="color: red;font-size: 45px;font-weight: bold;">'
.
$balance
.
'</p>
</div></div>'
;
// 添加统计数据
$box
->
content
(
$content
);
return
$box
->
render
();
});
$grid
->
addTableClass
([
'table-text-center'
]);
$grid
->
model
()
->
where
([
'sh_type'
=>
3
,
'um_id'
=>
$merchant_id
])
->
orderBy
(
'created_at'
,
'DESC'
);
$grid
->
column
(
'id'
)
->
sortable
();
$grid
->
column
(
'title'
,
'来源名称'
)
->
display
(
function
(
$val
)
{
return
$val
??
'用户取货佣金'
;
});
$grid
->
column
(
'divide_price'
,
'金额'
);
$grid
->
column
(
'created_at'
,
'时间'
);
$grid
->
disableDeleteButton
();
$grid
->
disableViewButton
();
$grid
->
disableCreateButton
();
$grid
->
disableBatchActions
();
$grid
->
disableRefreshButton
();
$grid
->
disableActions
();
$grid
->
disableRowSelector
();
// $grid->filter(function (Grid\Filter $filter) {
// $filter->equal('id');
// });
});
}
}
app/Store/Controllers/StoreIncomeController.php
View file @
0844224e
...
...
@@ -48,44 +48,4 @@ protected function grid()
// });
});
}
/**
* Make a show builder.
*
* @param mixed $id
*
* @return Show
*/
protected
function
detail
(
$id
)
{
return
Show
::
make
(
$id
,
new
StoreIncome
(),
function
(
Show
$show
)
{
$show
->
field
(
'id'
);
$show
->
field
(
'amout'
);
$show
->
field
(
'invoice'
);
$show
->
field
(
'feedback'
);
$show
->
field
(
'status'
);
$show
->
field
(
'created_at'
);
$show
->
field
(
'updated_at'
);
});
}
/**
* Make a form builder.
*
* @return Form
*/
protected
function
form
()
{
return
Form
::
make
(
new
StoreIncome
(),
function
(
Form
$form
)
{
$form
->
currency
(
'amount'
,
'金额'
)
->
symbol
(
'¥'
)
->
required
();
$form
->
multipleImage
(
'invoice'
,
'发票信息'
)
->
accept
(
'jpg,jpeg,png'
)
->
maxSize
(
2048
)
->
limit
(
9
)
->
url
(
'upload/store-invoice'
)
->
help
(
'仅支持jpg、jpeg、png格式图片上传'
)
->
autoUpload
()
->
saveAsJson
();
});
}
}
app/Store/routes.php
View file @
0844224e
...
...
@@ -27,4 +27,6 @@
$router
->
resource
(
'order'
,
'OrderInfoController'
);
//订单管理
$router
->
resource
(
'income'
,
'StoreIncomeController'
);
//提现管理
$router
->
resource
(
'divide-record'
,
'OrderDivideRecordController'
);
//余额明细
});
lang/zh_CN/order-divide-record.php
0 → 100644
View file @
0844224e
<?php
return
[
'labels'
=>
[
'OrderDivideRecord'
=>
'余额明细'
,
'OrderDivideRecord'
=>
'余额明细'
,
],
'fields'
=>
[
'user_id'
=>
'用户ID'
,
'amount'
=>
'提现金额'
,
'status'
=>
'提现状态'
,
],
'options'
=>
[],
];
lang/zh_CN/store-income.php
View file @
0844224e
<?php
return
[
'labels'
=>
[
'StoreIncome'
=>
'提现
管理
'
,
'storeIncome'
=>
'提现
管理
'
,
'StoreIncome'
=>
'提现
明细
'
,
'storeIncome'
=>
'提现
明细
'
,
],
'fields'
=>
[
'user_id'
=>
'用户ID'
,
...
...
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