|
@@ -535,88 +535,93 @@ HTML;
|
|
|
return $model;
|
|
|
}
|
|
|
|
|
|
- public static function getBadge($where)
|
|
|
+ public static function getBadge($where, $user)
|
|
|
{
|
|
|
$price = self::getOrderPrice($where);
|
|
|
- return [
|
|
|
- [
|
|
|
- 'name' => '订单数量',
|
|
|
- 'field' => '件',
|
|
|
- 'count' => $price['count_sum'],
|
|
|
- 'background_color' => 'layui-bg-blue',
|
|
|
- 'col' => 2
|
|
|
- ],
|
|
|
- [
|
|
|
- 'name' => '售出商品',
|
|
|
- 'field' => '件',
|
|
|
- 'count' => $price['total_num'],
|
|
|
- 'background_color' => 'layui-bg-blue',
|
|
|
- 'col' => 2
|
|
|
- ],
|
|
|
- [
|
|
|
- 'name' => '订单金额',
|
|
|
- 'field' => '元',
|
|
|
- 'count' => $price['pay_price'],
|
|
|
- 'background_color' => 'layui-bg-blue',
|
|
|
- 'col' => 2
|
|
|
- ],
|
|
|
- [
|
|
|
- 'name' => '退款金额',
|
|
|
- 'field' => '元',
|
|
|
- 'count' => $price['refund_price'],
|
|
|
- 'background_color' => 'layui-bg-blue',
|
|
|
- 'col' => 2
|
|
|
- ],
|
|
|
- [
|
|
|
- 'name' => '微信支付金额',
|
|
|
- 'field' => '元',
|
|
|
- 'count' => $price['pay_price_wx'],
|
|
|
- 'background_color' => 'layui-bg-blue',
|
|
|
- 'col' => 2
|
|
|
- ],
|
|
|
- [
|
|
|
- 'name' => '余额支付金额',
|
|
|
- 'field' => '元',
|
|
|
- 'count' => $price['pay_price_yue'],
|
|
|
- 'background_color' => 'layui-bg-blue',
|
|
|
- 'col' => 2
|
|
|
- ],
|
|
|
- [
|
|
|
- 'name' => '运费金额',
|
|
|
- 'field' => '元',
|
|
|
- 'count' => $price['pay_postage'],
|
|
|
- 'background_color' => 'layui-bg-blue',
|
|
|
- 'col' => 2
|
|
|
- ],
|
|
|
- [
|
|
|
- 'name' => '分佣金额',
|
|
|
- 'field' => '元',
|
|
|
- 'count' => $price['brokerage'],
|
|
|
- 'background_color' => 'layui-bg-blue',
|
|
|
- 'col' => 2
|
|
|
- ],
|
|
|
- [
|
|
|
- 'name' => '线下支付金额',
|
|
|
- 'field' => '元',
|
|
|
- 'count' => $price['pay_price_offline'],
|
|
|
- 'background_color' => 'layui-bg-blue',
|
|
|
- 'col' => 2
|
|
|
- ],
|
|
|
- [
|
|
|
- 'name' => '积分抵扣',
|
|
|
- 'field' => '分',
|
|
|
- 'count' => $price['use_integral'] . '(抵扣金额:¥' . $price['deduction_price'] . ')',
|
|
|
- 'background_color' => 'layui-bg-blue',
|
|
|
- 'col' => 2
|
|
|
- ],
|
|
|
- [
|
|
|
- 'name' => '退回积分',
|
|
|
- 'field' => '元',
|
|
|
- 'count' => $price['back_integral'],
|
|
|
- 'background_color' => 'layui-bg-blue',
|
|
|
- 'col' => 2
|
|
|
- ]
|
|
|
- ];
|
|
|
+ if ($user['roles'] == 1){
|
|
|
+ return [
|
|
|
+ [
|
|
|
+ 'name' => '订单数量',
|
|
|
+ 'field' => '件',
|
|
|
+ 'count' => $price['count_sum'],
|
|
|
+ 'background_color' => 'layui-bg-blue',
|
|
|
+ 'col' => 2
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ 'name' => '售出商品',
|
|
|
+ 'field' => '件',
|
|
|
+ 'count' => $price['total_num'],
|
|
|
+ 'background_color' => 'layui-bg-blue',
|
|
|
+ 'col' => 2
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ 'name' => '订单金额',
|
|
|
+ 'field' => '元',
|
|
|
+ 'count' => $price['pay_price'],
|
|
|
+ 'background_color' => 'layui-bg-blue',
|
|
|
+ 'col' => 2
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ 'name' => '退款金额',
|
|
|
+ 'field' => '元',
|
|
|
+ 'count' => $price['refund_price'],
|
|
|
+ 'background_color' => 'layui-bg-blue',
|
|
|
+ 'col' => 2
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ 'name' => '微信支付金额',
|
|
|
+ 'field' => '元',
|
|
|
+ 'count' => $price['pay_price_wx'],
|
|
|
+ 'background_color' => 'layui-bg-blue',
|
|
|
+ 'col' => 2
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ 'name' => '余额支付金额',
|
|
|
+ 'field' => '元',
|
|
|
+ 'count' => $price['pay_price_yue'],
|
|
|
+ 'background_color' => 'layui-bg-blue',
|
|
|
+ 'col' => 2
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ 'name' => '运费金额',
|
|
|
+ 'field' => '元',
|
|
|
+ 'count' => $price['pay_postage'],
|
|
|
+ 'background_color' => 'layui-bg-blue',
|
|
|
+ 'col' => 2
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ 'name' => '分佣金额',
|
|
|
+ 'field' => '元',
|
|
|
+ 'count' => $price['brokerage'],
|
|
|
+ 'background_color' => 'layui-bg-blue',
|
|
|
+ 'col' => 2
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ 'name' => '线下支付金额',
|
|
|
+ 'field' => '元',
|
|
|
+ 'count' => $price['pay_price_offline'],
|
|
|
+ 'background_color' => 'layui-bg-blue',
|
|
|
+ 'col' => 2
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ 'name' => '积分抵扣',
|
|
|
+ 'field' => '分',
|
|
|
+ 'count' => $price['use_integral'] . '(抵扣金额:¥' . $price['deduction_price'] . ')',
|
|
|
+ 'background_color' => 'layui-bg-blue',
|
|
|
+ 'col' => 2
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ 'name' => '退回积分',
|
|
|
+ 'field' => '元',
|
|
|
+ 'count' => $price['back_integral'],
|
|
|
+ 'background_color' => 'layui-bg-blue',
|
|
|
+ 'col' => 2
|
|
|
+ ]
|
|
|
+ ];
|
|
|
+ }else{
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|