|
@@ -58,7 +58,7 @@ class StoreOrder extends BaseModel
|
|
|
return $data;
|
|
|
}
|
|
|
|
|
|
- public static function OrderList($where)
|
|
|
+ public static function OrderList($where, $roles)
|
|
|
{
|
|
|
$model = self::getOrderWhere($where, self::alias('a')
|
|
|
->join('user r', 'r.uid=a.uid', 'LEFT'), 'a.', 'r')
|
|
@@ -212,6 +212,9 @@ HTML;
|
|
|
} else if ($item['paid'] == 1 && $item['refund_status'] == 2) {
|
|
|
$item['_status'] = 7;
|
|
|
}
|
|
|
+ if ($roles > 1){
|
|
|
+ $item['pay_price'] = 0;
|
|
|
+ }
|
|
|
}
|
|
|
if (isset($where['excel']) && $where['excel'] == 1) {
|
|
|
self::SaveExcel($data);
|
|
@@ -535,88 +538,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 [];
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|