view.php 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <?php
  2. use common\helpers\Url;
  3. use common\helpers\Html;
  4. use yii\grid\GridView;
  5. use common\enums\GenderEnum;
  6. use common\helpers\ImageHelper;
  7. use common\helpers\DebrisHelper;
  8. use common\enums\CreditsLogTypeEnum;
  9. use common\enums\MemberStatusEnum;
  10. $this->title = '个人资料';
  11. ?>
  12. <style>
  13. .box-body .table {
  14. border: none;
  15. border-collapse: separate;
  16. border-spacing: 5px;
  17. }
  18. .box-body .table > thead > tr > th,
  19. .box-body .table > tbody > tr > th,
  20. .box-body .table > tfoot > tr > th,
  21. .box-body .table > thead > tr > td,
  22. .box-body .table > tbody > tr > td,
  23. .box-body .table > tfoot > tr > td {
  24. border-top: 0 solid #e4eaec;
  25. line-height: 1.42857;
  26. padding: 8px;
  27. vertical-align: middle;
  28. }
  29. .box-body .table tr td {
  30. padding: 4px 8px;
  31. height: 28px;
  32. line-height: 12px;
  33. border: none;
  34. text-align: left;
  35. padding-left: 10px;
  36. color: #000;
  37. font-size: 12px;
  38. border-radius: 4px;
  39. background: #f1f1f1;
  40. }
  41. </style>
  42. <div class="row">
  43. <div class="col-12">
  44. <div class="box">
  45. <div class="box-body table-responsive">
  46. <table class="table">
  47. <tbody>
  48. <tr>
  49. <td rowspan="6" style="background: #ffffff;text-align: right;width: 200px">
  50. <img src="<?= ImageHelper::defaultHeaderPortrait($member->head_portrait)?>" style="width: 200px">
  51. </td>
  52. </tr>
  53. <tr>
  54. <td>昵称:<?= Html::encode($member->nickname) ?></td>
  55. <td>姓名:<?= Html::encode($member->realname) ?></td>
  56. <td>账号:<?= Html::encode($member->username) ?></td>
  57. <td>会员ID:<?= $member->id ?></td>
  58. </tr>
  59. <tr>
  60. <td colspan="2">可用余额:<?= $member->account->user_money ?? '' ?></td>
  61. <td>可用积分:<?= $member->account->user_integral ?? '' ?></td>
  62. <td>成长值:<?= $member->account->user_growth ?? '' ?></td>
  63. </tr>
  64. <tr>
  65. <td>会员级别:<?= $member->memberLevel->name ?? '' ?></td>
  66. <td>
  67. 生日:<?= $member->birthday ?>
  68. </td>
  69. <td>
  70. 性别:<?= GenderEnum::getValue($member->gender) ?>
  71. </td>
  72. <td>推广码:<?= $member['promoter_code'] ?></td>
  73. </tr>
  74. <tr>
  75. <td colspan="2">手机号码:<?= $member['mobile'] ?></td>
  76. <td colspan="2">
  77. 推荐人:
  78. <?php if ($member->parent) { ?>
  79. <a href="<?= Url::toRoute(['/member/member/view', 'id' => $member->pid]) ?>" class="openIframeView blue"><?= Html::encode($member->parent->nickname) ?></a>
  80. <?php } else { ?>
  81. <?php } ?>
  82. </td>
  83. </tr>
  84. <tr>
  85. <td colspan="6">
  86. 会员状态:<?= MemberStatusEnum::html($member['status']) ?>
  87. </td>
  88. </tr>
  89. <tr>
  90. <td>访问次数:<?= $member['visit_count'] ?></td>
  91. <td>最近登录IP:<?= $member['last_ip'] ?></td>
  92. <td>最近登录时间:<?= !empty($member['last_time']) ? Yii::$app->formatter->asDatetime($member['last_time']) : ''; ?></td>
  93. <td colspan="2">最近登录地点:<?= DebrisHelper::analysisIp($member['last_ip']) ?></td>
  94. </tr>
  95. </tbody>
  96. </table>
  97. </div>
  98. </div>
  99. </div>
  100. </div>
  101. <div class="row">
  102. <div class="col-12">
  103. <div class="nav-tabs-custom">
  104. <ul class="nav nav-tabs">
  105. <li class="<?= $type == CreditsLogTypeEnum::USER_MONEY ? 'active' : ''; ?>"><a href="<?= Url::to(['view', 'id' => $id, 'type' => CreditsLogTypeEnum::USER_MONEY])?>"> 余额日志</a></li>
  106. <li class="<?= $type == CreditsLogTypeEnum::USER_INTEGRAL ? 'active' : ''; ?>"><a href="<?= Url::to(['view', 'id' => $id, 'type' => CreditsLogTypeEnum::USER_INTEGRAL])?>"> 积分日志</a></li>
  107. <li class="<?= $type == CreditsLogTypeEnum::USER_GROWTH ? 'active' : ''; ?>"><a href="<?= Url::to(['view', 'id' => $id, 'type' => CreditsLogTypeEnum::USER_GROWTH])?>"> 成长值日志</a></li>
  108. <li class="<?= $type == CreditsLogTypeEnum::CONSUME_MONEY ? 'active' : ''; ?>"><a href="<?= Url::to(['view', 'id' => $id, 'type' => CreditsLogTypeEnum::CONSUME_MONEY])?>"> 消费日志</a></li>
  109. </ul>
  110. <div class="tab-content">
  111. <div class="active tab-pane rf-auto">
  112. <?= GridView::widget([
  113. 'dataProvider' => $dataProvider,
  114. 'filterModel' => $searchModel,
  115. // 重新定义分页样式
  116. 'tableOptions' => ['class' => 'table table-hover'],
  117. 'columns' => [
  118. [
  119. 'class' => 'yii\grid\SerialColumn',
  120. ],
  121. [
  122. 'label' => '变动数量',
  123. 'attribute' => 'num',
  124. 'format' => 'raw',
  125. 'headerOptions' => ['class' => 'text-align-center'],
  126. 'contentOptions' => ['class' => 'text-align-center'],
  127. 'value' => function ($model) {
  128. return $model->num > 0 ? "<span class='green'>$model->num</span>" : "<span class='red'>$model->num</span>";
  129. },
  130. ],
  131. [
  132. 'label' => '变动后数量',
  133. 'attribute' => 'new_num',
  134. 'headerOptions' => ['class' => 'text-align-center'],
  135. 'contentOptions' => ['class' => 'text-align-center'],
  136. 'filter' => Html::activeTextInput($searchModel, 'new_num', [
  137. 'class' => 'form-control',
  138. 'placeholder' => '变动后数量'
  139. ]
  140. ),
  141. 'value' => function ($model) {
  142. // return $model->old_num . $operational . abs($model->num) . '=' . $model->new_num;
  143. return $model->new_num;
  144. },
  145. ],
  146. 'remark',
  147. [
  148. 'attribute' => 'created_at',
  149. 'filter' => false, //不显示搜索框
  150. 'format' => ['date', 'php:Y-m-d H:i:s'],
  151. ],
  152. ],
  153. ]); ?>
  154. </div>
  155. </div>
  156. </div>
  157. </div>
  158. </div>
粤ICP备19079148号