소스 검색

Merge branch 'master' of http://18.167.157.193:1026/guanli/ngds into feature/1540-theo-auto-mesure-up

# Conflicts:
#	frontendApi/modules/v1/controllers/DashboardController.php
theo 3 년 전
부모
커밋
fca335541b

+ 2 - 2
backendApi/config/menu.php

@@ -109,8 +109,8 @@ return [
             //['name'=>'体系导出', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'system-export', 'routePath'=>'user/system-export', 'show'=>0,],
             //['name'=>'团队领导人列表', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'group', 'routePath'=>'user/group', 'show'=>1,],
             //['name'=>'团队领导人列表导出', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'group-export', 'routePath'=>'user/group-export', 'show'=>0,],
-            ['name'=>'Move network management', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'move', 'routePath'=>'user/move', 'show'=>1,],//移网管理
-            ['name'=>'申请移网', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'move-add', 'routePath'=>'user/move-add', 'show'=>0,],
+            ['name'=>'Move network management', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'move', 'routePath'=>'user/move', 'show'=>1,], // 移网管理
+            ['name'=>'Apply for moving network', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'move-add', 'routePath'=>'user/move-add', 'show'=>0,], // 申请移网
             ['name'=>'移网修改并审核', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'move-pass', 'routePath'=>'user/move-pass', 'show'=>0,],
             ['name'=>'移网审核', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'move-audit', 'routePath'=>'user/move-audit', 'show'=>0,],
             ['name'=>'移网导出', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'move-export', 'routePath'=>'user/move-export', 'show'=>0,],

+ 2 - 0
backendApi/config/urlManagerRules.php

@@ -499,6 +499,8 @@ return [
             'GET detail' => 'detail',
             'GET detail/<id>' => 'detail',
             'GET,POST article-delete' => 'article-delete',
+            'GET,POST article-hide' => 'article-hide',
+            'GET,POST article-un-hide' => 'article-un-hide',
             'GET category' => 'category',
             'POST category-add' => 'category-add',
             'GET,POST category-delete' => 'category-delete',

+ 28 - 0
backendApi/modules/v1/controllers/ArticleController.php

@@ -142,6 +142,34 @@ class ArticleController extends BaseController
         return $result;
     }
 
+    /**
+     * 隐藏
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionArticleHide(){
+        $adForm = new ArticleForm();
+        $result = static::hide(Article::class, 'hide', function ($selected) use ($adForm) {
+        }, function ($selected) use ($adForm) {
+        }, true);
+        return $result;
+    }
+
+    /**
+     * 取消隐藏
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionArticleUnHide(){
+        $adForm = new ArticleForm();
+        $result = static::hide(Article::class, 'un-hide', function ($selected) use ($adForm) {
+        }, function ($selected) use ($adForm) {
+        }, true);
+        return $result;
+    }
+
     /**
      * 获取文章详细
      * @return mixed

+ 2 - 2
backendApi/modules/v1/models/lists/bonus/PeriodBonusList.php

@@ -498,11 +498,11 @@ class PeriodBonusList extends \common\libs\dataList\DataList implements DataList
 //                        'prop'=>'ORI_BONUS_BD',
 //                    ],
 //                ],
-                'REAL_BONUS_QUARTER' => [
+                'BONUS_QUARTER' => [
                     'header' => 'Quarterly Bonus',// 季度分红
                     'value' => function($row) {
                         return (new Price([
-                            'value' => $row['REAL_BONUS_QUARTER'],
+                            'value' => $row['BONUS_QUARTER'],
                         ]))->result();
                     },
                     'headerOther' => [

+ 1 - 1
backendEle/src/router/index.js

@@ -345,7 +345,7 @@ export const constantRouterMap = [
         component: _import('user/move-add'),
         name: 'user_move-add',
         meta: {
-          title: '申请移网',
+          title: 'Apply for moving network', // 申请移网
           highLight: '/user/move',
           breadcrumb: [
             {title: 'Dashboard', path: '/dashboard/index'},

+ 4 - 4
backendEle/src/views/ad/edit.vue

@@ -54,8 +54,8 @@ export default {
         this.form.type = response.oneData.TYPE
 
         this.imageAd = response.oneData.IMAGE;
-        this.form.image = response.oneData.IMAGE.indexOf('http') > -1 ? response.oneData.IMAGE : SERVER_API_HTTP_TYPE + SERVER_API_DOMAIN + '/uploads/' + response.oneData.IMAGE;
-        this.defaultImageUrl = response.oneData.IMAGE.indexOf('http') > -1 ? response.oneData.IMAGE : SERVER_API_HTTP_TYPE + SERVER_API_DOMAIN + '/uploads/' + response.oneData.IMAGE;
+        this.form.image = SERVER_API_HTTP_TYPE + SERVER_API_DOMAIN + '/uploads/' + response.oneData.IMAGE;
+        this.defaultImageUrl = SERVER_API_HTTP_TYPE + SERVER_API_DOMAIN + '/uploads/' + response.oneData.IMAGE;
 
         this.form.content = response.oneData.CONTENT
         if (response.oneData.TYPE === '1') {
@@ -121,8 +121,8 @@ export default {
     },
     handleSuccess (imageUrl) {
       this.imageAd = imageUrl
-      this.form.image = imageUrl.indexOf('http') > -1 ? imageUrl : SERVER_API_HTTP_TYPE + SERVER_API_DOMAIN + '/uploads/' + imageUrl;
-      this.defaultImageUrl = imageUrl.indexOf('http') > -1 ? imageUrl : SERVER_API_HTTP_TYPE + SERVER_API_DOMAIN + '/uploads/' + imageUrl;
+      this.form.image = SERVER_API_HTTP_TYPE + SERVER_API_DOMAIN + '/uploads/' + imageUrl;
+      this.defaultImageUrl = SERVER_API_HTTP_TYPE + SERVER_API_DOMAIN + '/uploads/' + imageUrl;
     },
   },
   watch: {

+ 1 - 1
backendEle/src/views/ad/list.vue

@@ -272,7 +272,7 @@ export default {
       })
     },
     getImage(imageUrl) {
-      return imageUrl.indexOf('http') > -1 ? imageUrl : SERVER_API_HTTP_TYPE + SERVER_API_DOMAIN + '/uploads/' + imageUrl;
+      return SERVER_API_HTTP_TYPE + SERVER_API_DOMAIN + '/uploads/' + imageUrl;
     },
     getContent(aid) {
       let titles = this.allArticle.filter(article => article.ID === aid).map(article => article.TITLE);

+ 1 - 1
backendEle/src/views/article/detail.vue

@@ -48,7 +48,7 @@ export default {
       })
     },
     getLink(fileUrl) {
-      return fileUrl.indexOf('http') > -1 ? fileUrl : SERVER_API_HTTP_TYPE + SERVER_API_DOMAIN + '/uploads/' + fileUrl;
+      return SERVER_API_HTTP_TYPE + SERVER_API_DOMAIN + '/uploads/' + fileUrl;
     },
   }
 }

+ 79 - 0
backendEle/src/views/article/index.vue

@@ -32,6 +32,13 @@
             {{tool.formatDate(scope.row.CREATED_AT)}}
           </template>
         </el-table-column>
+        <el-table-column label="Status"> <!-- 状态 -->
+          <template slot-scope="scope">
+            <div v-if="scope.row.STATUS === '1'">Show</div>
+            <div v-else>Hide</div>
+          </template>
+        </el-table-column>
+
         <el-table-column fixed="right" label="Action" width="180"><!--操作-->
           <template slot-scope="scope">
             <el-dropdown size="small" trigger="click">
@@ -41,6 +48,8 @@
               <el-dropdown-menu slot="dropdown">
                 <el-dropdown-item command="edit" @click.native="handleEdit(scope.row)">Edit</el-dropdown-item>
                 <el-dropdown-item command="delete" @click.native="handleDelete(scope.row)">Delete</el-dropdown-item>
+                <el-dropdown-item command="hide" @click.native="handleHide(scope.row)">Hide</el-dropdown-item>
+                <el-dropdown-item command="un-hide" @click.native="handleUnHide(scope.row)">UnHide</el-dropdown-item>
               </el-dropdown-menu>
             </el-dropdown>
           </template>
@@ -53,6 +62,8 @@
           </el-button>
           <el-dropdown-menu slot="dropdown">
             <el-dropdown-item command="delete" @click.native="handleMuliDel()">Delete</el-dropdown-item>
+            <el-dropdown-item command="hide" @click.native="handleMultiHide()">Hide</el-dropdown-item>
+            <el-dropdown-item command="un-hide" @click.native="handleMultiUnHide()">UnHide</el-dropdown-item>
           </el-dropdown-menu>
         </el-dropdown>
         <el-button type="primary" size="small" @click="handleAdd">New article</el-button><!--添加文章-->
@@ -113,9 +124,21 @@ export default {
     handleDelete (row) {
       this.delData(row.ID)
     },
+    handleHide (row) {
+      this.hideData(row.ID)
+    },
+    handleUnHide(row) {
+      this.unHideData(row.ID)
+    },
     handleMuliDel () {
       this.delData()
     },
+    handleMultiHide () {
+      this.hideData()
+    },
+    handleMultiUnHide () {
+      this.unHideData()
+    },
     handleChangeSort (row, sort) {
       network.getData('/article/sort', {id: row.ID, sort: sort}).then(_ => {
         this.getData(this.currentPage, this.pageSize)
@@ -154,6 +177,62 @@ export default {
         obj.getData(obj.currentPage, obj.pageSize)
       }).catch(response => {
 
+      })
+    },
+    hideData (id = null) {
+      let obj = this
+      obj.$confirm('Are you sure to hide the selected data?', 'Notice', { // 确定删除选定的数据?
+        confirmButtonText: 'confirm', // 确定
+        cancelButtonText: 'cancel', // 取消
+        type: 'warning'
+      }).then(() => {
+        let selectedIds = []
+        if (id === null) {
+          for (let val of obj.multipleSelection) {
+            selectedIds.push(val.ID)
+          }
+        } else {
+          selectedIds.push(id)
+        }
+        return network.postData(`article/article-hide`, {
+          selected: selectedIds
+        })
+      }).then(response => {
+        this.$message({
+          message: response,
+          type: 'success'
+        })
+        obj.getData(obj.currentPage, obj.pageSize)
+      }).catch(response => {
+
+      })
+    },
+    unHideData (id = null) {
+      let obj = this
+      obj.$confirm('Are you sure to un-hide the selected data?', 'Notice', { // 确定删除选定的数据?
+        confirmButtonText: 'confirm', // 确定
+        cancelButtonText: 'cancel', // 取消
+        type: 'warning'
+      }).then(() => {
+        let selectedIds = []
+        if (id === null) {
+          for (let val of obj.multipleSelection) {
+            selectedIds.push(val.ID)
+          }
+        } else {
+          selectedIds.push(id)
+        }
+        return network.postData(`article/article-un-hide`, {
+          selected: selectedIds
+        })
+      }).then(response => {
+        this.$message({
+          message: response,
+          type: 'success'
+        })
+        obj.getData(obj.currentPage, obj.pageSize)
+      }).catch(response => {
+
       })
     },
   }

+ 1 - 5
backendEle/src/views/shop/index.vue

@@ -318,11 +318,7 @@
                     //   })
 
                     vueObj.form.coverOrigin = response.goodsInfo.COVER
-                    if (response.goodsInfo.COVER.indexOf('/') === -1) {
-                        vueObj.form.cover = SERVER_API_HTTP_TYPE + SERVER_API_DOMAIN + '/uploads/' + response.goodsInfo.COVER
-                    } else {
-                        vueObj.form.cover = response.goodsInfo.COVER
-                    }
+                    vueObj.form.cover = SERVER_API_HTTP_TYPE + SERVER_API_DOMAIN + '/uploads/' + response.goodsInfo.COVER
 
                     this.$forceUpdate()
                 })

+ 121 - 121
backendEle/src/views/user/move-add.vue

@@ -3,16 +3,16 @@
     <div class="white-box">
       <el-form ref="form" :model="form" label-width="250px" class="form-page">
 
-        <el-form-item label="移网类型">
-          <el-select v-model="form.type" placeholder="请选择移网类型" @change="chkAlert">
+        <el-form-item label="Moving network type"> <!-- 移网类型 -->
+          <el-select v-model="form.type" placeholder="Please select moving network type" @change="chkAlert"> <!-- 请选择移网类型 -->
             <el-option v-for="(item,key) in netType" :label="item.name" :value="item.id" :key="key"></el-option>
           </el-select>
         </el-form-item>
         <div v-if="form.type==='network'">
-          <el-form-item label="移动会员编号">
+          <el-form-item label="Move Member Code"> <!-- 移动会员编号 -->
             <el-input v-model="form.moveUserName" @blur="handleChkUser"></el-input>
           </el-form-item>
-          <el-form-item label="移动会员姓名" v-if="moveUser">
+          <el-form-item label="Move Member Name" v-if="moveUser"> <!-- 移动会员姓名 -->
             <el-input v-model="moveUser.REAL_NAME" :disabled="true"></el-input>
           </el-form-item>
 <!--          <el-form-item label="原上级编号" v-if="moveUser">-->
@@ -21,20 +21,20 @@
 <!--          <el-form-item label="原上级姓名" v-if="moveUser">-->
 <!--            <el-input v-model="moveUser.CON_REAL_NAME" :disabled="true"></el-input>-->
 <!--          </el-form-item>-->
-          <el-form-item label="移动到节点会员编号">
+          <el-form-item label="Move to node member code"> <!-- 移动到节点会员编号 -->
             <el-input v-model="form.toConUserName"></el-input>
             <el-tag v-if="showToName==''?false:true">{{showToName}}</el-tag>
             <el-alert :title="toAlertTile" :type="toAlertType" :closable="false" v-show="toAlertShow"></el-alert>
           </el-form-item>
-          <el-form-item label="移动到节点会员姓名">
+          <el-form-item label="Move to node member code"> <!-- 移动到节点会员编号 -->
             <el-input v-model="form.toConRealName"></el-input>
           </el-form-item>
         </div>
         <div v-if="form.type==='relation'">
-          <el-form-item label="移动会员编号">
+          <el-form-item label="Move Member Code"> <!-- 移动会员编号 -->
             <el-input v-model="form.moveUserName" @blur="handleChkUser"></el-input>
           </el-form-item>
-          <el-form-item label="移动会员姓名" v-if="moveUser">
+          <el-form-item label="Move Member Name" v-if="moveUser"> <!-- 移动会员姓名 -->
             <el-input v-model="moveUser.REAL_NAME" :disabled="true"></el-input>
           </el-form-item>
 <!--          <el-form-item label="原开拓人编号" v-if="moveUser">-->
@@ -43,25 +43,25 @@
 <!--          <el-form-item label="原开拓人姓名" v-if="moveUser">-->
 <!--            <el-input v-model="moveUser.REC_REAL_NAME" :disabled="true"></el-input>-->
 <!--          </el-form-item>-->
-          <el-form-item label="移动到开拓会员编号">
+          <el-form-item label="Move to development member code"> <!-- 移动到开拓会员编号 -->
             <el-input v-model="form.toConUserName"></el-input>
             <el-tag v-if="showToName==''?false:true">{{showToName}}</el-tag>
             <el-alert :title="toAlertTile" :type="toAlertType" :closable="false" v-show="toAlertShow"></el-alert>
           </el-form-item>
-          <el-form-item label="移动到开拓会员姓名">
+          <el-form-item label="Move to development member code"> <!-- 移动到开拓会员编号 -->
             <el-input v-model="form.toConRealName"></el-input>
           </el-form-item>
         </div>
 
-        <el-form-item v-if="form.type==='network'" label="移动到区位">
-          <el-select v-model="form.location" placeholder="移动到区位">
-            <el-option label="一市场" :value="1" key="location_1"></el-option>
-            <el-option label="二市场" :value="2" key="location_2"></el-option>
-            <el-option label="三市场" :value="3" key="location_3"></el-option>
+        <el-form-item v-if="form.type==='network'" label="Move to location"> <!-- 移动到区位 -->
+          <el-select v-model="form.location" placeholder="Move to location"> <!-- 移动到区位 -->
+            <el-option label="I. Market" value="1" key="location_1"></el-option><!-- 一市场 -->
+            <el-option label="II. Market" value="2" key="location_2"></el-option><!-- 二市场 -->
+            <el-option label="III. Market" value="3" key="location_3"></el-option><!-- 三市场 -->
           </el-select>
         </el-form-item>
 
-        <el-form-item label="备注" v-if="form.type">
+        <el-form-item label="Note" v-if="form.type"> <!-- 备注 -->
           <el-input v-model="form.remark"></el-input>
         </el-form-item>
 
@@ -74,121 +74,121 @@
 </template>
 
 <script>
-  import Vue from 'vue'
-  import store from '@/utils/vuexStore'
-  import network from '@/utils/network'
-  import tool from '@/utils/tool'
+import Vue from 'vue'
+import store from '@/utils/vuexStore'
+import network from '@/utils/network'
+import tool from '@/utils/tool'
 
-  export default {
-    name: 'user_move-add',
-    created() {
+export default {
+  name: 'user_move-add',
+  created () {
 
+  },
+  mounted () {
+    network.getData('user/move-net-type').then(response => {
+      this.netType = response.netType
+      this.loading = false
+    })
+  },
+  data () {
+    return {
+      form: {
+        moveUserName: null,
+        toConUserName: null,
+        toConRealName: null,
+        type: null,
+        location: null,
+        remark: null,
+      },
+      moveUser: {},
+      netType: null,
+      loading: true,
+      submitButtonStat: false,
+      openBanks: null,
+      toAlertShow: false,
+      toAlertTile: '',
+      toAlertType: 'success',
+      isRelation: false,
+      showToName: '',
+    }
+  },
+  methods: {
+    chkAlert () {
+      // if(this.form.type==='network'){
+      //   this.chkRelation()
+      // }else{
+      //   this.toAlertShow=false
+      // }
+
+      this.toAlertShow = false
     },
-    mounted() {
-      network.getData('user/move-net-type').then(response => {
-        this.netType = response.netType
-        this.loading = false
-      })
-    },
-    data() {
-      return {
-        form: {
-          moveUserName: null,
-          toConUserName: null,
-          toConRealName: null,
-          type: null,
-          location: 1,
-          remark: null,
-        },
-        moveUser: {},
-        netType: null,
-        loading: true,
-        submitButtonStat: false,
-        openBanks: null,
-        toAlertShow:false,
-        toAlertTile:'',
-        toAlertType:'success',
-        isRelation:false,
-        showToName:'',
+    handleChkUser () {
+      if (this.form.moveUserName) {
+        this.loading = true
+        network.getData('user/full-info', {userName: this.form.moveUserName}).then(response => {
+          this.moveUser = response
+          this.loading = false
+        }).catch(response => {
+          this.loading = false
+        })
       }
     },
-    methods: {
-      chkAlert(){
-        // if(this.form.type==='network'){
-        //   this.chkRelation()
-        // }else{
-        //   this.toAlertShow=false
-        // }
-
-        this.toAlertShow=false
-      },
-      handleChkUser() {
-        if (this.form.moveUserName) {
-          this.loading = true
-          network.getData('user/full-info', {userName: this.form.moveUserName}).then(response => {
-            this.moveUser = response
-            this.loading = false
-          }).catch(response => {
-            this.loading = false
-          })
-        }
-      },
-      chkRelation(){
-        if (this.form.toConUserName&&this.form.moveUserName) {
-          this.loading = true
-          this.toAlertShow=false
-          network.getData('user/chk-relation', {userName: this.form.moveUserName,toUserName:this.form.toConUserName}).then(response => {
-            if(response.is===1){
-              this.isRelation=true
-              this.toAlertTile='在同一推荐网络内'
-              this.toAlertType='success'
-            }else{
-              this.isRelation=false
-              this.toAlertTile='不同一推荐网络内'
-              this.toAlertType='warning'
-            }
-            this.showToName=response.real_name
-            this.toAlertShow=true
-            this.loading = false
-          }).catch(response => {
-            this.loading = false
-          })
-        }
-      },
-      onSubmit() {
-        let thisObj=this
-        // if(thisObj.form.type==='network' && this.isRelation===false){
-        //   thisObj.$confirm('不在同一推荐网络内是否确认处理', 'Hint', {
-        //     confirmButtonText: 'confirm', // 确定
-        //     cancelButtonText: 'cancel', // 取消
-        //     type: 'warning'
-        //   }).then(() => {
-        //     thisObj._handleSubmit()
-        //   }).catch(() => {
-        //
-        //   })
-        // }else{
-        //   thisObj._handleSubmit()
-        // }
-
-        thisObj._handleSubmit()
-      },
-      _handleSubmit(){
-        this.submitButtonStat = true
-        let path = 'user/move-add'
-        network.postData(path, this.form).then(response => {
-          this.$message({
-            message: response,
-            type: 'success'
-          })
-          this.submitButtonStat = false
-          this.$router.go(-1)
+    chkRelation () {
+      if (this.form.toConUserName && this.form.moveUserName) {
+        this.loading = true
+        this.toAlertShow = false
+        network.getData('user/chk-relation', {userName: this.form.moveUserName, toUserName: this.form.toConUserName}).then(response => {
+          if (response.is === 1) {
+            this.isRelation = true
+            this.toAlertTile = '在同一推荐网络内'
+            this.toAlertType = 'success'
+          } else {
+            this.isRelation = false
+            this.toAlertTile = '不同一推荐网络内'
+            this.toAlertType = 'warning'
+          }
+          this.showToName = response.real_name
+          this.toAlertShow = true
+          this.loading = false
         }).catch(response => {
-          this.submitButtonStat = false
+          this.loading = false
         })
       }
+    },
+    onSubmit () {
+      let thisObj = this
+      // if(thisObj.form.type==='network' && this.isRelation===false){
+      //   thisObj.$confirm('不在同一推荐网络内是否确认处理', 'Hint', {
+      //     confirmButtonText: 'confirm', // 确定
+      //     cancelButtonText: 'cancel', // 取消
+      //     type: 'warning'
+      //   }).then(() => {
+      //     thisObj._handleSubmit()
+      //   }).catch(() => {
+      //
+      //   })
+      // }else{
+      //   thisObj._handleSubmit()
+      // }
+
+      thisObj._handleSubmit()
+    },
+    _handleSubmit () {
+      this.submitButtonStat = true
+      let path = 'user/move-add'
+      network.postData(path, this.form).then(response => {
+        this.$message({
+          message: response,
+          type: 'success'
+        })
+        this.submitButtonStat = false
+        this.$router.go(-1)
+      }).catch(response => {
+        this.submitButtonStat = false
+      })
     }
   }
+}
 </script>
 
 <style scoped>

+ 2 - 2
common/models/UserMove.php

@@ -39,8 +39,8 @@ class UserMove extends \common\components\ActiveRecord
     const TYPE_RELATION = NetPoint::NET_TYPE_RELATION;
 
     const TYPE_NAME = [
-        self::TYPE_NETWORK => ['id' => self::TYPE_NETWORK, 'name' => '安置网络',],
-        self::TYPE_RELATION => ['id' => self::TYPE_RELATION, 'name' => '开拓网络',],
+        self::TYPE_NETWORK => ['id' => self::TYPE_NETWORK, 'name' => 'Placement network',], // 安置网络
+        self::TYPE_RELATION => ['id' => self::TYPE_RELATION, 'name' => 'Sponor network',], // 开拓网络
     ];
 
     const STATUS_APPLIED = 0;       // 已申请

+ 1 - 1
common/models/forms/NetMoveForm.php

@@ -293,7 +293,7 @@ class NetMoveForm extends Model {
         }
 
         $this->adminOperateLogger->afterInsert($model)->clean()->save([
-            'optType' => '申请移网',
+            'optType' => 'Apply for moving network', // 申请移网
             'userId' => $model->USER_ID,
             'userName' => Info::getUserNameByUserId($model->USER_ID),
             'remark' => $this->remark

+ 2 - 2
frontendApi/config/menu.php

@@ -86,8 +86,8 @@ return [
             ['name'=>'申请提现', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'withdraw-add', 'routePath'=>'finance/withdraw-add', 'show'=>0,],
             ['name'=>'Recharge details', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'recharge', 'routePath'=>'finance/recharge', 'show'=>1,],//充值明细
             ['name'=>'Apply for recharge', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'recharge-add', 'routePath'=>'finance/recharge-add', 'show'=>0,], // 申请充值
-            ['name'=>'Transfer record list', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'transfer-list', 'routePath'=>'finance/transfer-list', 'show'=>1,'allow'=>'transferRecordSwitch'],
-            ['name'=>'Apply for Transfer', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'transfer-add', 'routePath'=>'finance/transfer-add', 'show'=>1,'allow'=>'transferSwitch'], // 我要转账
+            ['name'=>'Transfer details', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'transfer-list', 'routePath'=>'finance/transfer-list', 'show'=>1,'allow'=>'transferRecordSwitch'],
+            ['name'=>'Apply for Transfer', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'transfer-add', 'routePath'=>'finance/transfer-add', 'show'=>0,'allow'=>'transferSwitch'], // 我要转账
         ]
     ],
 //    'finance'=>[

+ 1 - 1
frontendApi/modules/v1/controllers/DashboardController.php

@@ -95,7 +95,7 @@ class DashboardController extends BaseController
         ];
 
         //剩余分期PV显示
-        $myRemainPv = RemainPv::findOne(['USER_ID'=>$baseInfo['ID']])->REMAIN_PV?:0;
+        $myRemainPv = RemainPv::findOne(['USER_ID'=>$baseInfo['ID']])->REMAIN_PV ?? 0;
 
         return static::notice([
             'nowTime' => $nowTime,

+ 2 - 0
frontendApi/modules/v1/controllers/ShopController.php

@@ -318,6 +318,8 @@ class ShopController extends BaseController {
             $value['TAX_AMOUNT'] = Tool::calculateTax($value['REAL_PRICE'], floatval($value['TAX_RATE']), intval($value['BUY_NUMS']));
             $value['STATUS'] = \Yii::$app->params['orderStatus'][$value['STATUS']]['label'] ?? '';
             $value['CREATED_AT'] = $value['CREATED_AT'] ? Date::convert($value['CREATED_AT'],'Y-m-d H:i:s') : '';
+            $value['REAL_PV'] = Tool::formatPrice($value['REAL_PV'] * $value['BUY_NUMS']);
+            $value['TOTAL_AMOUNT'] = Tool::formatPrice($value['REAL_PRICE'] * $value['BUY_NUMS']);
         }
 
         return static::notice($data);

+ 2 - 2
frontendEle/src/router/index.js

@@ -455,7 +455,7 @@ export const constantRouterMap = [
         component: _import('finance/transfer-list'),
         name: 'finance_transfer-list',
         meta: {
-          title: 'Tranfer record',
+          title: 'Transfer',
           breadcrumb: [
             {title: 'Dashboard', path: '/dashboard/index'},
             {title: 'Financial management', path: '/finance/index'},
@@ -467,7 +467,7 @@ export const constantRouterMap = [
         component: _import('finance/transfer-add'),
         name: 'finance_transfer-add',
         meta: {
-          title: 'Transfer list',
+          title: 'Transfer Add',
           highLight: '/finance/transfer-list',
           breadcrumb: [
             {title: 'Dashboard', path: '/dashboard/index'},

+ 1 - 1
frontendEle/src/views/dashboard/index.vue

@@ -159,7 +159,7 @@
         }
       },
       imageArticle(imageUrl) {
-        return imageUrl.indexOf('http') > -1 ? imageUrl : SERVER_API_HTTP_TYPE + SERVER_API_DOMAIN + '/uploads/' + imageUrl;
+        return SERVER_API_HTTP_TYPE + SERVER_API_DOMAIN + '/uploads/' + imageUrl;
       },
     }
   }

+ 1 - 1
frontendEle/src/views/finance/transfer-list.vue

@@ -30,7 +30,7 @@
         <el-table-column label="Remark" prop="REMARK"></el-table-column> <!-- 备注 -->
       </el-table>
       <div class="white-box-footer">
-        <!--<el-button type="primary" size="small" @click="handleAdd">我要转账</el-button>-->
+        <el-button type="primary" size="small" @click="handleAdd">Apply for Transfer</el-button><!--我要转账-->
         <pagination :total="totalCount" :page_size="pageSize" @size-change="handleSizeChange" @current-change="handleCurrentChange"></pagination>
       </div>
     </div>

+ 3 - 2
frontendEle/src/views/shop/dec-order-list.vue

@@ -4,11 +4,12 @@
             <el-table class="withdraw-table" :data="tableData" :max-height="maxHeight" style="width: 100%;" :span-method="objectSpanMethod">
 				        <el-table-column width="120" label="Product code" prop="SKU_CODE"></el-table-column><!--商品编号-->
                 <el-table-column width="120" label="Product Name" prop="GOODS_TITLE"></el-table-column><!--商品名称-->
+                <el-table-column width="120" label="Product Price" prop="REAL_PRICE"></el-table-column><!--报单金额-->
+                <el-table-column width="120" label="Product BV" prop="REAL_PV"></el-table-column><!--报单BV-->
                 <el-table-column width="120" label="Qty" prop="BUY_NUMS"></el-table-column><!--数量-->
-                <el-table-column width="120" label="Price" prop="REAL_PRICE"></el-table-column><!--报单金额-->
-                <el-table-column width="120" label="BV" prop="REAL_PV"></el-table-column><!--报单BV-->
                 <el-table-column width="120" label="Tax rate" prop="TAX_RATE"></el-table-column><!--税率-->
                 <el-table-column width="120" label="Tax" prop="TAX_AMOUNT"></el-table-column><!--税额-->
+                <el-table-column width="120" label="Total Price" prop="TOTAL_AMOUNT"></el-table-column><!--总计金额-->
                 <el-table-column width="120" label="Code" prop="DEC_SN"></el-table-column><!--报单编号-->
                 <el-table-column width="120" label="Order code" prop="ORDER_SN"></el-table-column><!--订单编号-->
                 <el-table-column width="120" label="Member code" prop="USER_NAME"></el-table-column><!--会员编号-->

+ 3 - 5
frontendEle/src/views/shop/index.vue

@@ -17,14 +17,14 @@
 
                       </el-table-column>
 
-                      <el-table-column label="Product picture" ><!--图片-->
+                      <el-table-column label="Product Picture" ><!--图片-->
                         <template slot-scope="scope">
 <!--                          <img :src="scope.row.COVER" alt="" style="width:100px" >-->
                           <el-image style="width: 100px; height: 100px" :src="scope.row.COVER" :preview-src-list="[scope.row.COVER]"></el-image>
                         </template>
                       </el-table-column>
 
-                      <el-table-column label="Product price" prop="SELL_PRICE"><!--商品价格-->
+                      <el-table-column label="Product Price" prop="SELL_PRICE"><!--商品价格-->
                           <template slot-scope="scope">
                               <span>{{ Math.round(scope.row.SELL_PRICE * 100) / 100 }}</span>
                           </template>
@@ -269,9 +269,7 @@ export default {
                                     break;
                                 }
                             }
-                            if (obj.tableData[i].COVER.indexOf('/') === -1) {
-                              obj.tableData[i].COVER = SERVER_API_HTTP_TYPE + SERVER_API_DOMAIN + '/uploads/' + obj.tableData[i].COVER
-                            }
+                            obj.tableData[i].COVER = SERVER_API_HTTP_TYPE + SERVER_API_DOMAIN + '/uploads/' + obj.tableData[i].COVER
                         }
                         obj.selectLock = false;
                     })

+ 26 - 0
sql/upgrade/1350.sql

@@ -34,3 +34,29 @@ CREATE TABLE `AR_CALC_BONUS_QUARTER`  (
   `CREATED_AT` datetime(0) NOT NULL,
   PRIMARY KEY (`ID`) USING BTREE
 ) ENGINE = InnoDB AUTO_INCREMENT = 2005 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
+
+DROP TABLE IF EXISTS `AR_QTR_CALC_WEIGHT`;
+CREATE TABLE `AR_QTR_CALC_WEIGHT`  (
+    `ID` int(11) NOT NULL AUTO_INCREMENT,
+    `USER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+    `MAX_SORT` int(11) NULL DEFAULT NULL,
+    `WEIGHT` decimal(16, 3) NULL DEFAULT NULL,
+    `PERIOD_NUM` int(11) NULL DEFAULT NULL,
+    `CALC_MONTH` int(11) NULL DEFAULT NULL,
+    `CALC_YEAR` int(11) NULL DEFAULT NULL,
+    PRIMARY KEY (`ID`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 512 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
+
+DROP TABLE IF EXISTS `AR_QTR_CALC_SCORE`;
+CREATE TABLE `AR_QTR_CALC_SCORE`  (
+    `ID` int(11) NOT NULL AUTO_INCREMENT,
+    `USER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+    `CNT` int(11) NOT NULL,
+    `SCORE` decimal(16, 3) NOT NULL,
+    `CALC_MONTH` int(11) NULL DEFAULT NULL,
+    `CALC_YEAR` int(11) NULL DEFAULT NULL,
+    PRIMARY KEY (`ID`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 256 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
+
+alter table `AR_CALC_BONUS` add column ORI_BONUS_QUARTER decimal(16,2) not null default 0.00 comment "季度奖-原奖金";
+alter table `AR_CALC_BONUS` add column BONUS_QUARTER decimal(16,2) not null default 0.00 comment "季度奖";

+ 133 - 0
sql/upgrade/QTRCALC.sql

@@ -0,0 +1,133 @@
+CREATE DEFINER=`black_tea_0309`@`%` PROCEDURE `QTRCALC`(IN `PCPID` INT)
+LABEL: BEGIN
+-- DECLARE QTRSTARTPID, QTRSTARTMONTH, THISYEAR, THISMONTH, MISMONTH INT;
+
+DECLARE TBONUS,BONUSPERU DECIMAL; -- 奖金总额,每份奖金
+DECLARE QTRSTARTMONTH, THISYEAR, THISMONTH, MISMONTH INT; -- 这个月
+
+-- DECLARE OCROWN1NUM,OCROWN2NUM,OCROWN3NUM,OCROWN4NUM,OCROWN5NUM,OCROWN6NUM,OCROWN7NUM INT; -- 各星级的人数,原始不加权
+-- DECLARE  CROWN1U, CROWN2U, CROWN3U, CROWN4U, CROWN5U, CROWN6U, CROWN7U INT; -- 各星级的人数(加权)
+
+DECLARE TOTALU INT; -- 加权的总份数
+
+DECLARE MAXID, USERTBID INT;
+DECLARE Q, R INT;
+
+START TRANSACTION;
+-- 日志;
+DELETE FROM AR_QTR_CALC_RECORD ;
+CALL QTRCALCRECORD(-1,'开始',PCPID,NOW());
+COMMIT;
+
+CALL QTRCLEAN(PCPID);
+CALL QTRCALCRECORD(1,'清除数据',PCPID,NOW());
+COMMIT;
+
+SELECT
+ CALC_YEAR, CALC_MONTH, IS_MONTH INTO THISYEAR, THISMONTH, MISMONTH FROM AR_PERIOD WHERE PERIOD_NUM = PCPID;
+
+CALL QTRCALCRECORD(2,'初始化',PCPID,NOW());
+COMMIT;
+
+-- 查看是否季度结
+
+IF(THISMONTH!=3 AND THISMONTH!=6 AND THISMONTH!=9 AND THISMONTH!=12) OR MISMONTH!=1 THEN
+  CALL QTRCALCRECORD(12,'非季结,结束',PCPID,NOW());
+	COMMIT;
+  LEAVE LABEL;
+END IF;
+
+CALL QTRCALCRECORD(3,'计算总奖金',PCPID,NOW());
+COMMIT;
+
+-- 按照条件,查询当前季度所有月的总PV,计算总奖金
+SET QTRSTARTMONTH = THISMONTH - 2;
+
+SELECT 
+   SUM(PV_PCS) * 0.02 
+INTO TBONUS
+  FROM AR_PERF_MONTH 
+WHERE CALC_MONTH >= CONCAT(THISYEAR, lpad(QTRSTARTMONTH,2,0)) AND CALC_MONTH <= CONCAT(THISYEAR, lpad(THISMONTH,2,0));
+
+CALL QTRCALCRECORD(4,'计算总人数及加权',PCPID,NOW());
+COMMIT;
+
+
+-- 查找,所有星级用户
+INSERT INTO AR_QTR_CALC_WEIGHT
+	SELECT 
+		NULL AS ID,
+		QY.USER_ID,
+		MAX(CL.SORT) AS MAX_SORT,
+		(CL.SORT - 1)/2 + 1 AS WEIGHT,
+		PERIOD_NUM,
+		CALC_MONTH,
+		CALC_YEAR
+	FROM
+		AR_CALC_BONUS_QY AS QY
+	 INNER JOIN 
+		AR_CROWN_LEVEL AS CL
+	 ON QY.LAST_CROWN_LV = CL.ID
+	 
+	WHERE
+		QY.LAST_CROWN_LV != (SELECT ID FROM AR_CROWN_LEVEL WHERE SORT = 0)
+
+	GROUP BY USER_ID, CALC_MONTH;
+
+COMMIT;
+
+INSERT INTO AR_QTR_CALC_SCORE
+	SELECT
+		NULL AS ID,
+		USER_ID, 
+		COUNT(*) AS CNT,
+		SUM(WEIGHT) AS SCORE,
+		CALC_MONTH,
+		CALC_YEAR
+	FROM 
+		AR_QTR_CALC_WEIGHT
+	GROUP BY USER_ID;
+
+COMMIT;
+	
+SELECT SUM(SCORE) INTO TOTALU FROM AR_QTR_CALC_SCORE;
+
+SET BONUSPERU = TBONUS / TOTALU;
+
+
+CALL QTRCALCRECORD(5,'计算每一份奖金',PCPID,NOW());
+COMMIT;
+
+
+
+INSERT INTO AR_QTR_CALC_USER
+	SELECT 
+		NULL AS ID,
+		SC.USER_ID,
+		BONUSPERU * SC.SCORE AS AMOUNT,
+		CALC_YEAR,
+		CALC_MONTH,
+		PCPID AS PERIOD_NUM
+	FROM
+		AR_QTR_CALC_SCORE AS SC;
+
+
+INSERT INTO AR_CALC_BONUS_QUARTER
+	SELECT
+		NULL AS ID,
+		USER_ID,
+		AMOUNT AS ORI_BONUS,
+		0 AS MANAGE_TAX,
+		AMOUNT,
+		0 AS RECONSUME_POINTS,
+		CALC_YEAR, 
+		CALC_MONTH, 
+		PERIOD_NUM,
+		NOW() AS CREATE_AT
+	FROM
+		AR_QTR_CALC_USER;
+
+CALL QTRCALCRECORD(20,'写入季度奖金表',PCPID,NOW());
+COMMIT;	
+
+END

+ 14 - 0
sql/upgrade/QTRCLEAN.sql

@@ -0,0 +1,14 @@
+CREATE DEFINER=`black_tea_0309`@`%` PROCEDURE `QTRCLEAN`(IN `PCPID` INT)
+BEGIN-- 删除当期奖金
+	DELETE 
+	FROM
+		AR_CALC_BONUS_QUARTER
+	WHERE
+		PERIOD_NUM >= PCPID;
+  TRUNCATE
+		AR_QTR_CALC_USER;
+	TRUNCATE
+		AR_QTR_CALC_WEIGHT;
+	TRUNCATE
+		AR_QTR_CALC_SCORE;
+END