active.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?php
  2. use yii\widgets\LinkPager;
  3. use common\helpers\Url;
  4. use yii\grid\GridView;
  5. use kartik\daterange\DateRangePicker;
  6. use yii\widgets\ActiveForm;
  7. $addon = <<< HTML
  8. <span class="input-group-addon">
  9. <i class="glyphicon glyphicon-calendar"></i>
  10. </span>
  11. HTML;
  12. $memberActive = \addons\TinyShop\common\enums\MemberActiveEnum::getMap();
  13. $this->title = '用户分析';
  14. $this->params['breadcrumbs'][] = ['label' => $this->title];
  15. ?>
  16. <div class="row">
  17. <div class="col-sm-12">
  18. <div class="nav-tabs-custom">
  19. <ul class="nav nav-tabs">
  20. <li><a href="<?= Url::to(['index']) ?>"> 用户分析</a></li>
  21. <?php foreach ($memberActive as $key => $value) { ?>
  22. <li class="<?= $type == $key ? 'active' : ''; ?>"><a
  23. href="<?= Url::to(['active', 'type' => $key]) ?>"> <?= $value; ?></a></li>
  24. <?php } ?>
  25. </ul>
  26. <div class="tab-content">
  27. <div class="active tab-pane">
  28. <div class="row">
  29. <span class="pb-2 pl-2 help">筛选条件: <?= $time['explain']; ?></span>
  30. <div class="col-lg-12">
  31. <?= GridView::widget([
  32. 'dataProvider' => $dataProvider,
  33. 'filterModel' => $searchModel,
  34. //重新定义分页样式
  35. 'tableOptions' => ['class' => 'table table-hover'],
  36. 'columns' => [
  37. [
  38. 'class' => 'yii\grid\SerialColumn',
  39. 'visible' => false, // 不显示#
  40. ],
  41. [
  42. 'attribute' => 'buyer_id',
  43. 'label' => '用户ID',
  44. 'headerOptions' => ['class' => 'col-md-1'],
  45. ],
  46. [
  47. 'attribute' => 'member.nickname',
  48. 'format' => 'raw',
  49. 'value' => function ($model) {
  50. return '<span class="member-view pointer blue"
  51. data-href='. Url::to([
  52. '/member/view',
  53. 'member_id' => $model['buyer_id'],
  54. ]). '>
  55. ' . $model['member']['nickname'] . '
  56. </span>';
  57. },
  58. ],
  59. 'member.mobile',
  60. [
  61. 'attribute' => 'count',
  62. 'label' => '订单笔数',
  63. 'value' => function ($model) {
  64. return $model->count;
  65. }
  66. ],
  67. [
  68. 'attribute' => 'product_count',
  69. 'label' => '订单量',
  70. ],
  71. [
  72. 'attribute' => 'pay_money',
  73. 'label' => '支付金额',
  74. ],
  75. [
  76. 'attribute' => 'refund_money',
  77. 'label' => '退款金额',
  78. ],
  79. [
  80. 'attribute' => 'order.order_sn',
  81. 'label' => '最后一次订单',
  82. 'format' => 'raw',
  83. 'value' => function ($model) {
  84. return '<span class="order-view blue pointer"
  85. data-href=' . Url::to(['/order/order/detail', 'id' => $model['id']]) . '>
  86. '. $model['order']['order_sn'] .'
  87. </span>';
  88. }
  89. ],
  90. [
  91. 'attribute' => 'created_at',
  92. 'label' => '最后一次消费时间',
  93. 'filter' => false, //不显示搜索框
  94. 'format' => ['date', 'php:Y-m-d H:i:s'],
  95. ],
  96. ],
  97. ]); ?>
  98. </div>
  99. </div>
  100. </div>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
粤ICP备19079148号