Просмотр исходного кода

积分日志增加英文备注

lizhen_gitee 7 месяцев назад
Родитель
Сommit
e0d87bd151

+ 2 - 2
application/admin/controller/Packageorder.php

@@ -137,7 +137,7 @@ class Packageorder extends Backend
     }
 
     /**
-     * 添加
+     * 用户下单
      *
      * @return string
      * @throws \think\Exception
@@ -223,7 +223,7 @@ class Packageorder extends Backend
         if($data['remain'] >= 5){
 
             //赠送积分
-            $wallet_rs = model('wallet')->lockChangeAccountRemain($user_id,'score',$data['price'],2,'线上购买配套','package_order',$order_id);
+            $wallet_rs = model('wallet')->lockChangeAccountRemain($user_id,'score',$data['price'],4,'线下购买配套','package_order',$order_id,'Buy package offline');
             if($wallet_rs['status'] === false){
                 Db::rollback();
                 return false;

+ 3 - 9
application/admin/controller/user/User.php

@@ -77,13 +77,6 @@ class User extends Backend
 
     /**
      * 注册会员
-     *
-     * @ApiMethod (POST)
-     * @param string $username 用户名
-     * @param string $password 密码
-     * @param string $email    邮箱
-     * @param string $mobile   手机号
-     * @param string $code     验证码
      */
     public function add()
     {
@@ -153,10 +146,11 @@ class User extends Backend
 
             $user_id = input('user_id');
             $score  = input('score');
-            $remark = input('remark','后台调节');
+            $remark = input('remark','线下修改');
+            $remark_en = input('remark_en','Offline modification');
 
             Db::startTrans();
-            $rs = model('wallet')->lockChangeAccountRemain($user_id,'score',$score,1,$remark);
+            $rs = model('wallet')->lockChangeAccountRemain($user_id,'score',$score,1,$remark,'admin',$this->auth->id,$remark_en);
             if($rs['status'] === false){
                 Db::rollback();
                 $this->error($rs['msg']);

+ 1 - 0
application/admin/lang/zh-cn/userscorelog.php

@@ -10,6 +10,7 @@ return [
     'Table'          => '数据来源',
     'Table_id'       => '数据来源ID',
     'Remark'         => '备注',
+    'Remark_en'      => '备注(en)',
     'Createtime'     => '创建时间',
     'Updatetime'     => '更新时间',
     'User.username'  => '用户名',

+ 2 - 0
application/admin/view/lessonslot/index.html

@@ -36,6 +36,8 @@
                     <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
                            data-operate-edit="{:$auth->check('lessonslot/edit')}"
                            data-operate-del="{:$auth->check('lessonslot/del')}"
+                           data-operate-booking="{:$auth->check('lessonslot/booking')}"
+                           data-operate-cancel="{:$auth->check('lessonslot/cancel')}"
                            width="100%">
                     </table>
                 </div>

+ 4 - 2
application/admin/view/packageorder/index.html

@@ -16,8 +16,8 @@
                 <div class="widget-body no-padding">
                     <div id="toolbar" class="toolbar">
                         <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
-                        <!--<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('packageorder/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
-                        <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('packageorder/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
+                        <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('packageorder/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
+                        <!--<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('packageorder/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
                         <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('packageorder/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
                         
 
@@ -34,6 +34,8 @@
                     <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
                            data-operate-edit="{:$auth->check('packageorder/edit')}"
                            data-operate-del="{:$auth->check('packageorder/del')}"
+                           data-operate-jihuo="{:$auth->check('packageorder/jihuo')}"
+                           data-operate-cancel="{:$auth->check('packageorder/cancel')}"
                            width="100%">
                     </table>
                 </div>

+ 1 - 0
application/admin/view/user/user/index.html

@@ -35,6 +35,7 @@
                     <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
                            data-operate-edit="{:$auth->check('user/user/edit')}"
                            data-operate-del="{:$auth->check('user/user/del')}"
+                           data-operate-updatescore="{:$auth->check('user/user/updatescore')}"
                            width="100%">
                     </table>
                 </div>

+ 7 - 0
application/admin/view/user/user/updatescore.html

@@ -22,6 +22,13 @@
         </div>
     </div>
 
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">备注(en):</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-remark_en" data-rule="required" class="form-control" name="remark_en" type="text" value="">
+        </div>
+    </div>
+
     <div class="form-group layer-footer">
         <label class="control-label col-xs-12 col-sm-2"></label>
         <div class="col-xs-12 col-sm-8">

+ 2 - 2
application/api/controller/Notify.php

@@ -200,7 +200,7 @@ class Notify extends Controller
             }
 
             //赠送积分
-            $wallet_rs = model('wallet')->lockChangeAccountRemain($orderInfo['user_id'],'score',$orderInfo['order_amount'],3,'线上预约课程','lesson_order',$orderInfo['table_id']);
+            $wallet_rs = model('wallet')->lockChangeAccountRemain($orderInfo['user_id'],'score',$orderInfo['order_amount'],3,'线上预约课程','lesson_order',$orderInfo['table_id'],'Booking courses online');
             if($wallet_rs['status'] === false){
                 Db::rollback();
                 return false;
@@ -251,7 +251,7 @@ class Notify extends Controller
             if($package_order['remain'] >= 5){
 
                 //赠送积分
-                $wallet_rs = model('wallet')->lockChangeAccountRemain($orderInfo['user_id'],'score',$orderInfo['order_amount'],2,'线上购买配套','package_order',$orderInfo['table_id']);
+                $wallet_rs = model('wallet')->lockChangeAccountRemain($orderInfo['user_id'],'score',$orderInfo['order_amount'],2,'线上购买配套','package_order',$orderInfo['table_id'],'Buy package online');
                 if($wallet_rs['status'] === false){
                     Db::rollback();
                     return false;

+ 2 - 1
application/api/controller/Userwallet.php

@@ -30,12 +30,13 @@ class Userwallet extends Api
         }else{
             $where['change_value'] = ['lt',0];
         }
-        $list = Db::name('user_score_log')->field('id,before,change_value,remain,remark,createtime')
+        $list = Db::name('user_score_log')->field('id,before,change_value,remain,remark,remark_en,createtime')
             ->where($where)->autopage()->order('id desc')->select();
 
         if(!empty($list)){
             foreach($list as $key => &$val){
                 $val['createtime'] = $this->datetime_lang($val['createtime']);
+                $val = $this->info_lang($val,['remark']);
             }
         }
 

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

@@ -67,7 +67,7 @@ class Wallet extends Model
      * @return array[log_table]
      * @return array[log_id]
      */
-    public function lockChangeAccountRemain($user_id,$accountType='money',$number,$logtype='',$remark='',$table='',$table_id=0,$isAdmin=false)
+    public function lockChangeAccountRemain($user_id,$accountType='money',$number,$logtype='',$remark='',$table='',$table_id=0,$remark_en='')
     {
         //初始化
         $result = array(
@@ -126,6 +126,7 @@ class Wallet extends Model
             $data['table'] = $table;
             $data['table_id'] = $table_id;
             $data['remark'] = $remark;
+            $data['remark_en'] = $remark_en;
             $data['createtime'] = time();
             $data['updatetime'] = time();
 

+ 3 - 2
application/extra/wallet.php

@@ -5,8 +5,9 @@
 return [
     'logtype' => [
         1  => '后台改动',
-        2  => '购买套餐',
-        3  => '预约课程',
+        2  => '线上购买配套',
+        3  => '线上预约课程',
+        4  => '线下购买配套',
     ],
     'moneyname' => [
         'score'    => '积分',

+ 1 - 0
public/assets/js/backend/userscorelog.js

@@ -40,6 +40,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 //                        {field: 'table', title: __('Table'), operate: 'LIKE'},
 //                        {field: 'table_id', title: __('Table_id')},
                         {field: 'remark', title: __('Remark'), operate: 'LIKE'},
+                        {field: 'remark_en', title: __('Remark_en'), operate: 'LIKE'},
                         {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
 //                        {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         /*{field: 'user.username', title: __('User.username'), operate: 'LIKE'},