Преглед изворни кода

Merge branch 'v4.7.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v4.7.0dev

From-wh пре 2 година
родитељ
комит
d9c659f426

+ 1 - 1
crmeb/app/adminapi/controller/v1/order/RefundOrder.php

@@ -146,7 +146,7 @@ class RefundOrder extends AuthController
             return app('json')->fail(400144);
         }
 
-        if ($data['type'] == 1) {
+        if ($data['type'] == 1 || $data['type'] == 5) {
             $data['refund_type'] = 6;
         } else if ($data['type'] == 2) {
             $data['refund_type'] = 3;

+ 1 - 1
crmeb/app/adminapi/controller/v1/user/User.php

@@ -387,7 +387,7 @@ class User extends AuthController
         if ($data['phone']) {
             if (!preg_match("/^1[3456789]\d{9}$/", $data['phone'])) return app('json')->fail(400252);
         }
-        if ($this->services->count(['phone' => $data['phone'], 'is_del' => 0])) {
+        if ($this->services->count(['phone' => $data['phone'], 'is_del' => 0, 'not_uid' => $id])) {
             return app('json')->fail(400314);
         }
         if ($data['card_id']) {

+ 8 - 1
crmeb/app/dao/user/UserBrokerageDao.php

@@ -33,6 +33,10 @@ class UserBrokerageDao extends BaseDao
      * @param int $limit
      * @param array $typeWhere
      * @return array
+     * @throws \ReflectionException
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function getList(array $where, string $field = '*', int $page = 0, int $limit = 0, array $typeWhere = [])
     {
@@ -68,7 +72,8 @@ class UserBrokerageDao extends BaseDao
      */
     public function brokerageRankList(array $where, int $page = 0, int $limit = 0)
     {
-        return $this->search($where)->field('uid,SUM(IF(pm=1,`number`,-`number`)) as brokerage_price')->with(['user' => function ($query) {
+        //SUM(IF(pm=1,`number`,-`number`))
+        return $this->search($where)->field('uid,SUM(number) as brokerage_price')->with(['user' => function ($query) {
             $query->field('uid,avatar,nickname');
         }])->order('brokerage_price desc')->group('uid')->when($page && $limit, function ($query) use ($page, $limit) {
             $query->page($page, $limit);
@@ -79,6 +84,7 @@ class UserBrokerageDao extends BaseDao
      * 获取某些条件的佣金总数
      * @param array $where
      * @return mixed
+     * @throws \ReflectionException
      */
     public function getBrokerageSumColumn(array $where)
     {
@@ -92,6 +98,7 @@ class UserBrokerageDao extends BaseDao
      * 获取某个账户下的冻结佣金
      * @param int $uid
      * @return float
+     * @throws \ReflectionException
      */
     public function getUserFrozenPrice(int $uid)
     {

+ 10 - 0
crmeb/app/model/user/User.php

@@ -440,4 +440,14 @@ class User extends BaseModel
     {
         if ($value !== '') $query->where('is_del', $value);
     }
+
+    /**
+     * 不等于uid搜索器
+     * @param $query
+     * @param $value
+     */
+    public function searchNotUidAttr($query, $value)
+    {
+        if ($value !== '') $query->where('uid', '<>', $value);
+    }
 }

+ 1 - 1
crmeb/app/services/order/StoreOrderCreateServices.php

@@ -798,7 +798,7 @@ class StoreOrderCreateServices extends BaseServices
                 //计算商品金额
                 if (sys_config('user_brokerage_type') == 1) {
                     //按照实际支付价格返佣
-                    $price = bcmul((string)$cart['truePrice'], $cartNum, 4);
+                    $price = bcmul((string)bcadd((string)$cart['truePrice'], (string)$cart['postage_price'], 2), $cartNum, 4);
                 } else {
                     //按照商品价格返佣
                     if (isset($productInfo['attrInfo'])) {

+ 1 - 1
crmeb/app/services/order/StoreOrderRefundServices.php

@@ -1064,7 +1064,7 @@ class StoreOrderRefundServices extends BaseServices
         if ($list) {
             foreach ($list as &$item) {
                 $item['paid'] = 1;
-                $item['add_time'] = $item['_add_time'] = isset($item['add_time']) ? date('Y-m-d H:i', (int)$item['add_time']) : '';
+                $item['add_time'] = $item['_add_time'] = isset($item['add_time']) ? date('Y-m-d H:i:s', (int)$item['add_time']) : '';
                 $item['cartInfo'] = $item['cart_info'];
                 if (in_array($item['refund_type'], [1, 2, 4, 5])) {
                     $item['refund_status'] = 1;

+ 1 - 0
crmeb/app/services/order/StoreOrderServices.php

@@ -2351,6 +2351,7 @@ HTML;
             }
         }
         $data['_status'] = $orderInfo['_status'] ?? [];
+        $data['_status']['_is_back'] = $orderInfo['delivery_type'] != 'fictitious' && $orderInfo['virtual_type'] == 0;
         $data['cartInfo'] = $data['cartInfo'] ?? $cartInfo;
         return $data;
     }

+ 15 - 2
crmeb/app/services/user/UserBrokerageServices.php

@@ -187,6 +187,7 @@ class UserBrokerageServices extends BaseServices
      * @param array|string[] $type
      * @param string $time
      * @return float
+     * @throws \ReflectionException
      */
     public function getUserBrokerageSum(int $uid, array $type = ['one_brokerage', 'two_brokerage', 'brokerage_user'], $time = '')
     {
@@ -271,7 +272,7 @@ class UserBrokerageServices extends BaseServices
      */
     public function brokerageRankList(string $time = 'week')
     {
-        $where = [];
+        $where = ['pm' => 1];
         if ($time) {
             $where['time'] = $time;
         }
@@ -296,10 +297,14 @@ class UserBrokerageServices extends BaseServices
      * 获取用户排名
      * @param int $uid
      * @param string $time
+     * @return false|int|string
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function getUserBrokerageRank(int $uid, string $time = 'week')
     {
-        $where = [];
+        $where = ['pm' => 1];
         if ($time) {
             $where['time'] = $time;
         }
@@ -327,6 +332,9 @@ class UserBrokerageServices extends BaseServices
      * 推广数据    昨天的佣金   累计提现金额  当前佣金
      * @param int $uid
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function commission(int $uid)
     {
@@ -354,6 +362,7 @@ class UserBrokerageServices extends BaseServices
      * @param array $where
      * @param int $time
      * @return mixed
+     * @throws \ReflectionException
      */
     public function getUsersBokerageSum(array $where, $time = 0)
     {
@@ -372,6 +381,10 @@ class UserBrokerageServices extends BaseServices
      * @param $uid
      * @param $type
      * @return array
+     * @throws \ReflectionException
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function getBrokerageList($uid, $type)
     {

+ 1 - 1
template/admin/src/pages/marketing/live/anchor.vue

@@ -26,7 +26,7 @@
         <template slot-scope="{ row, index }" slot="action">
           <a @click="edit(row.id)">修改</a>
           <Divider type="vertical" />
-          <a @click="del(row, '删除分组', index)">删除</a>
+          <a @click="del(row, '删除主播', index)">删除</a>
         </template>
       </Table>
       <div class="acea-row row-right page">

+ 5 - 4
template/admin/src/pages/marketing/live/components/live_detail.vue

@@ -12,7 +12,8 @@
         </div>
         <div class="list sp">
           <label class="name">直播间ID:</label>
-          <span class="info">{{ FormData.room_id }}</span>
+          <span class="info">{{ FormData.id }}</span>
+          <span class="info">(微信直播间ID:{{ FormData.room_id }})</span>
         </div>
         <div class="list sp">
           <label class="name">主播昵称:</label>
@@ -51,15 +52,15 @@
           <img style="max-width: 150px; height: 80px" :src="FormData.share_img" />
         </div>
         <div class="list sp">
-          <label class="name">是否关闭点赞:</label>
+          <label class="name">是否开启点赞:</label>
           <span class="info blue">{{ FormData.close_like | filterClose }}</span>
         </div>
         <div class="list sp">
-          <label class="name">是否关闭货架:</label>
+          <label class="name">是否开启货架:</label>
           <span class="info blue">{{ FormData.close_goods | filterClose }}</span>
         </div>
         <div class="list sp">
-          <label class="name">是否关闭评论:</label>
+          <label class="name">是否开启评论:</label>
           <span class="info blue">{{ FormData.close_comment | filterClose }}</span>
         </div>
 

+ 2 - 2
template/admin/src/pages/marketing/live/index.vue

@@ -79,8 +79,8 @@
           <a @click="detail(row, '详情')">详情</a>
           <Divider type="vertical" />
           <a @click="del(row, '删除这条信息', index)">删除</a>
-          <Divider type="vertical" />
-          <a @click="addGoods(row)">添加商品</a>
+          <Divider type="vertical"  v-if="row.live_status == 102"/>
+          <a v-if="row.live_status == 102" @click="addGoods(row)">添加商品</a>
         </template>
       </Table>
       <div class="acea-row row-right page">