Pārlūkot izejas kodu

后台,用户管理

lizhen_gitee 2 mēneši atpakaļ
vecāks
revīzija
64decacfc9

+ 1 - 11
application/admin/controller/user/User.php

@@ -86,7 +86,7 @@ class User extends Backend
             $wday = date('w'); // 星期几的数字表示    0(周日)到 6(周六)
             $wday_start = strtotime(date('Y-m-d', strtotime('-' . ($wday ? $wday - $day : 6) . ' day'))); // 本周开始日期
             $week_map = [
-                'log_type' => ['in', [21, 22, 23, 54, 58, 60, 82 ]]
+                'log_type' => ['in', [21, 22, 23, 54, 60, 72, 82 ]]
             ];
 
             $mt_user = Db::name('user');
@@ -173,15 +173,6 @@ class User extends Backend
                     }
                 }
                 Db::startTrans();
-                if (isset($params['vip_endtime'])) { //会员到期时间
-                    $rs = Db::name('user_wallet')->where(['user_id' => $ids])->setField('vip_endtime', strtotime($params['vip_endtime']));
-                    if ($rs === false) {
-                        Db::rollback();
-                        $this->error('会员到期时间有错误');
-                    }
-
-                    unset($params['vip_endtime']);
-                }
 
                 try {
                     //是否采用模型验证
@@ -217,7 +208,6 @@ class User extends Backend
             $this->error(__('Parameter %s can not be empty', ''));
         }
 
-        $row['vip_endtime'] = Db::name('user_wallet')->where(['user_id' => $ids])->value('vip_endtime');
         $this->view->assign("row", $row);
         return $this->view->fetch();
     }

+ 1 - 6
application/admin/view/user/user/edit.html

@@ -193,12 +193,7 @@
             <input id="c-frozentime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[frozentime]" type="text" value="{:$row.frozentime?datetime($row.frozentime):''}">
         </div>
     </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('会员到期时间')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-vip_endtime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[vip_endtime]" type="text" value="{:$row.vip_endtime?datetime($row.vip_endtime):''}">
-        </div>
-    </div>
+
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('是否客服')}:</label>
         <div class="col-xs-12 col-sm-8">

+ 14 - 1
application/api/controller/Relation.php

@@ -114,7 +114,7 @@ class Relation extends Api
 
             $money = bcdiv($info['price'],$bili,2);
             if($money > 0){
-                $rs_wallet = model('wallet')->lockChangeAccountRemain($info['uid'],0,'money',$money,72,'发布关系被绑定','user_relation',$id);
+                $rs_wallet = model('wallet')->lockChangeAccountRemain($info['uid'],0,'money',$money,72,'发布关系被绑定','user_relation',$id,2);
                 if($rs_wallet['status'] === false){
                     Db::rollback();
                     $this->error($rs_wallet['msg']);
@@ -143,6 +143,19 @@ class Relation extends Api
 
         }
 
+        //增加亲密度
+        $user_intimacy_rs = addintimacy($this->auth->id, $info['uid'], $info['price']);
+        if (!$user_intimacy_rs['status']) {
+            Db::rollback();
+            $this->error('您的网络开小差啦~');
+        }
+
+        //发送消息
+        if (isset($user_intimacy_rs) && $user_intimacy_rs['level_remark']) {
+            $tenim = new \app\api\controller\Tenim;
+            $tenim->sendMessageToUser($this->auth->id, $info['uid'], $user_intimacy_rs['level_remark'], 1);
+        }
+
         Db::commit();
         $this->success('绑定成功');
     }

+ 2 - 2
application/common/model/Wallet.php

@@ -156,9 +156,9 @@ class Wallet extends Model
 
             //新的方式
             $wallet_data[$accountType] = $data['remain'];
-            if ($is_pay_get == 1) { //累计消费:后台充值updategold,支付充值gold_notify_do
+            if ($is_pay_get == 1) { //累计充值:后台充值updategold,支付充值gold_notify_do
                 $wallet_data['pay_money'] = bcadd($wallet['pay_money'], bcdiv($number, config('site.rmb_to_gold'), 2)); //pay_money第1处修改
-            } elseif ($is_pay_get == 2) { //累计获得:聊天礼物得收益,动态礼物得收益,私聊+语音+视频得收益,被守护得收益
+            } elseif ($is_pay_get == 2) { //累计获得:聊天礼物得收益,动态礼物得收益,私聊+语音+视频得收益,被守护得收益,被绑定关系
                 $wallet_data['get_money'] = bcadd($wallet['get_money'], $number);  //get_money第1处修改,也是唯一一处
             }
             $rs1 = Db::name('user_wallet')->where(['user_id'=>$user_id])->update($wallet_data);

+ 1 - 3
new 2.txt

@@ -1,6 +1,4 @@
 男女任务不同
-清用户数据
-
-
+cos视频缩略工作流
 ////////////////////////////////
 活动页,两个统计数据

+ 1 - 1
public/assets/js/backend/user/user.js

@@ -61,7 +61,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         //{field: 'successions', title: __('Successions')},
                         //{field: 'maxsuccessions', title: __('Maxsuccessions')},
                         // {field: 'vip_endtime', title: __('会员到期时间'), operate:false},
-                        {field: 'wallet.vip_endtime', title: __('会员到期时间'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+//                        {field: 'wallet.vip_endtime', title: __('会员到期时间'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'prevtime', title: __('Prevtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         //{field: 'logintime', title: __('Logintime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         //{field: 'loginip', title: __('Loginip'), operate: 'LIKE'},