rabin 5 dagar sedan
förälder
incheckning
052779a4bb

+ 1 - 1
src/place/benefit/manage/score_exchange.php

@@ -6,7 +6,7 @@ return [
             'exchange_score_id' => [
                 'type' => 'select',
                 'tip' => '选择要兑换的目标积分',
-                'option' => 'Dever::call("Pscore/manage/info.getList", '.$score_id.')',
+                'option' => 'Dever::call("Pscore/Manage/Lib/Info.getList", '.$score_id.')',
             ],
             'value' => [
                 'tip' => '直接输入要兑换的数值,如输入100,就是当前积分1个可以兑换100个目标积分',

+ 5 - 1
src/place/interface/app/Api/Score.php

@@ -146,10 +146,14 @@ class Score extends Core
         $config = Dever::input('config', 'is_numeric', '提现账户');
         $realname = Dever::input('realname', 'is_string', '真实姓名');
         $account = Dever::input('account', 'is_string', '账户信息');
+        $bank = '';
+        if ($config == 3) {
+            $bank = Dever::input('bank', 'is_string', '开户行');
+        }
         if ($data['info']['withdraw'] != 1) {
             Dever::error('提现未开启');
         }
-        return Dever::load(\Pscore\Lib\Withdraw::class)->bind($data['info'], $this->place->uid, $config, $realname, $account);
+        return Dever::load(\Pscore\Lib\Withdraw::class)->bind($data['info'], $this->place->uid, $config, $realname, $account, $bank);
     }
 
 }

+ 0 - 1
src/place/interface/app/Api/Source.php

@@ -181,7 +181,6 @@ class Source extends Core
             'show_page'     => $info['show_page'],
             'show_submit'   => $info['show_submit'],
             'show_sell'     => $info['show_sell'],
-            'show_content'  => $info['show_content'],
         ];
         $data['have_vip'] = $info['have_vip'];
         $data['help'] = $info['help'];

+ 1 - 0
src/place/interface/app/Api/User.php

@@ -225,6 +225,7 @@ class User extends Core
         # 小程序
         $data['qrcode'] = $result['applet']['wechat'];
         $data['link'] = $result['h5'];
+        $data['path'] = $result['path'];
         return $data;
     }
 }

+ 19 - 0
src/place/order/app/Lib/Notify.php

@@ -163,6 +163,25 @@ class Notify
         }
     }
 
+    # 积分充值回调
+    protected function score_callback($order, $status)
+    {
+        if ($status == 1) {
+            $update['status'] = 2;
+        } else {
+            $update['status'] = 3;
+        }
+        $update['pdate'] = time();
+        $state = Dever::db('porder/score')->update($order['id'], $update);
+        if (!$state) {
+            return '订单更新失败';
+        }
+        if ($status == 1) {
+            # 成功增加积分
+            Dever::load(\Pscore\Lib\Log::class)->action('充值', $order['score_id'])->add($order['uid'], '', $order['recharge_cash']);
+        }
+    }
+
     # 发放销售渠道收益
     public function sales($order, $type = 'source')
     {

+ 45 - 42
src/place/order/app/Lib/Pay.php

@@ -303,56 +303,59 @@ class Pay
         # 记录购买订单数
         Dever::db('puser/info')->update($this->order['uid'], ['num_order' => ['+', 1]]);
 
-        $table = $this->type . '_detail';
         $use_promotion = [];
-        foreach ($this->detail as $v) {
-            $promotion = $v['promotion'];
-            unset($v['promotion']);
-            /*
-            $rebate = $v['rebate'];
-            unset($v['rebate']);
-            */
-
-            # 记录明细
-            $v['order_id'] = $order_id;
-            if ($promotion) {
-                $v['promotion_id'] = $promotion['id'];
-            }
-            $id = Dever::db('porder/' . $table)->insert($v);
-
-            # 记录销量
-            if (isset($v['source_id'])) {
-                Dever::db('psource/info')->update($v['source_id'], ['num_sell' => ['+', 1]]);
-            }
+        if ($this->detail) {
+            $table = $this->type . '_detail';
+            foreach ($this->detail as $v) {
+                $promotion = $v['promotion'];
+                unset($v['promotion']);
+                /*
+                $rebate = $v['rebate'];
+                unset($v['rebate']);
+                */
 
-            if ($id) {
-                # 记录促销
+                # 记录明细
+                $v['order_id'] = $order_id;
                 if ($promotion) {
-                    $promotion['table'] = $table;
-                    $promotion['table_id'] = $id;
-                    $promotion['promotion_id'] = $promotion['id'];
-                    unset($promotion['id']);
-                    if ($promotion['source_type'] == 1) {
-                        if (empty($use_promotion[$promotion['source_id']])) {
-                            $use_promotion[$promotion['source_id']] = 1;
+                    $v['promotion_id'] = $promotion['id'];
+                }
+                $id = Dever::db('porder/' . $table)->insert($v);
+
+                # 记录销量
+                if (isset($v['source_id'])) {
+                    Dever::db('psource/info')->update($v['source_id'], ['num_sell' => ['+', 1]]);
+                }
+
+                if ($id) {
+                    # 记录促销
+                    if ($promotion) {
+                        $promotion['table'] = $table;
+                        $promotion['table_id'] = $id;
+                        $promotion['promotion_id'] = $promotion['id'];
+                        unset($promotion['id']);
+                        if ($promotion['source_type'] == 1) {
+                            if (empty($use_promotion[$promotion['source_id']])) {
+                                $use_promotion[$promotion['source_id']] = 1;
+                            }
                         }
+                        
+                        Dever::db('porder/promotion')->insert($promotion);
                     }
-                    
-                    Dever::db('porder/promotion')->insert($promotion);
+                    # 记录返利 以后增加明细返利记录
+                    /*
+                    if ($rebate && $rebate['rule']) {
+                        foreach ($rebate['rule'] as $v1) {
+                            $v1['table'] = $table;
+                            $v1['table_id'] = $id;
+                            $v1['rebate_rule_id'] = $v1['id'];
+                            unset($v1['id']);
+                            Dever::db('porder/rebate')->insert($v1);
+                        }
+                    }*/
                 }
-                # 记录返利 以后增加明细返利记录
-                /*
-                if ($rebate && $rebate['rule']) {
-                    foreach ($rebate['rule'] as $v1) {
-                        $v1['table'] = $table;
-                        $v1['table_id'] = $id;
-                        $v1['rebate_rule_id'] = $v1['id'];
-                        unset($v1['id']);
-                        Dever::db('porder/rebate')->insert($v1);
-                    }
-                }*/
             }
         }
+        
 
         # 记录订单返利
         if ($this->set['rebate'] && $this->set['rebate']['rule']) {

+ 7 - 0
src/place/order/app/Lib/Score/Log.php

@@ -0,0 +1,7 @@
+<?php namespace Porder\Lib\Score;
+use Dever;
+use Porder\Lib\Log as Base;
+class Log extends Base
+{
+    protected $table = 'score_log';
+}

+ 1 - 20
src/place/order/app/Lib/Score/Pay.php

@@ -13,28 +13,9 @@ class Pay extends Core
         $this->order['recharge_id'] = $info['recharge']['id'];
         $this->order['recharge_cash'] = $info['recharge']['value'];
         $this->order['cash'] = $info['recharge']['price'];
+        $this->order['num'] = 1;
     }
 
     # 验证
     protected function check(){}
-    # 下单成功
-    protected function success($order_id){}
-    # 支付回调
-    protected function callback($order, $status)
-    {
-        if ($status == 1) {
-            $update['status'] = 2;
-        } else {
-            $update['status'] = 3;
-        }
-        $update['pdate'] = time();
-        $state = Dever::db('porder/score')->update($order['id'], $update);
-        if (!$state) {
-            return '订单更新失败';
-        }
-        if ($status == 1) {
-            # 成功增加积分
-            Dever::load(\Pscore\Lib\Log::class)->action('充值', $order['score_id'])->add($order['uid'], '', $order['recharge_cash']);
-        }
-    }
 }

+ 33 - 0
src/place/order/table/score_log.php

@@ -0,0 +1,33 @@
+<?php
+return [
+    'name' => '充值订单日志表',
+    'partition' => 'Dever::call("Manage/Lib/Util.system")',
+    'struct' => [
+        'order_id'       => [
+            'type'      => 'int(11)',
+            'name'      => '订单ID',
+        ],
+
+        'utype' => [
+            'name'      => '操作人类型',
+            'type'      => 'tinyint(1)',
+            'default'   => 1,
+            'value'     => [
+                -1 => '系统',
+                1 => '买家',
+                2 => '卖家',
+                3 => '渠道',
+            ],
+        ],
+
+        'uid'       => [
+            'type'      => 'int(11)',
+            'name'      => '操作人',
+        ],
+
+        'desc'      => [
+            'type'      => 'varchar(1000)',
+            'name'      => '操作明细',
+        ],
+    ],
+];

+ 3 - 1
src/place/score/app/Lib/Withdraw.php

@@ -12,6 +12,7 @@ class Withdraw
             if ($info) {
                 $v['realname'] = $info['realname'];
                 $v['account'] = $info['account'];
+                $v['bank'] = $info['bank'];
                 $v['tip'] = $info['realname'];
                 $v['status'] = 1;
             } else {
@@ -23,12 +24,13 @@ class Withdraw
     }
 
     # 绑定提现账户
-    public function bind($info, $uid, $id, $realname, $account)
+    public function bind($info, $uid, $id, $realname, $account, $bank)
     {
         $data = ['uid' => $uid, 'type' => $id, 'status' => 1];
         $info = Dever::db('pscore/user_account')->find($data);
         $data['realname'] = $realname;
         $data['account'] = $account;
+        $data['bank'] = $bank;
         if ($info) {
             $state = Dever::db('pscore/user_account')->update($info['id'], $data);
         } else {

+ 2 - 2
src/place/score/manage/user_withdraw_audit.php

@@ -25,10 +25,10 @@ return [
                 'option' => array
                 (
                     ['id' => 1, 'name' => '手动打款'],
-                    ['id' => 2, 'name' => '自动打款'],
+                    //['id' => 2, 'name' => '自动打款'],
                 ),
                 'value' => 1,
-                'desc' => '选择自动打款到对方账户,请保证您的支付账户资金余额充足',
+                'desc' => '暂时仅支持手动打款,选择自动打款到对方账户,请保证您的支付账户资金余额充足',
             ],
             'desc' => [
                 'name' => '备注',

+ 13 - 3
src/place/score/table/user_account.php

@@ -11,11 +11,11 @@ return [
         'type' => [
             'name'      => '类型',
             'type'      => 'tinyint(1)',
-            'default'   => 1,
+            'default'   => 2,
             'value'     => [
-                1 => '微信',
+                //1 => '微信',
                 2 => '支付宝',
-                //3 => '银行卡',
+                3 => '银行卡',
             ],
         ],
 
@@ -29,6 +29,16 @@ return [
             'type'      => 'varchar(150)',
         ],
 
+        'bank'        => [
+            'name'      => '开户行',
+            'type'      => 'varchar(500)',
+        ],
+
+        'qrcode'        => [
+            'name'      => '收款码',
+            'type'      => 'varchar(150)',
+        ],
+
         'status' => [
             'name'      => '状态',
             'type'      => 'tinyint(1)',

+ 1 - 1
src/place/score/table/user_withdraw.php

@@ -31,7 +31,7 @@ return [
             'value'     => [
                 1 => '微信',
                 2 => '支付宝',
-                //3 => '银行卡',
+                3 => '银行卡',
             ],
         ],
 

+ 8 - 4
src/place/set/app/Lib/Info.php

@@ -40,8 +40,11 @@ class Info
             }
             $code = $this->encode(...$code);
 
-            $host = 'https://h5.yijiudingsheng.com';
-            $path = '/pages/main?p=' . $code;
+            $host = $info['host'];
+            $result['path'] = '/pages/main?p=' . $code;
+            if ($type > 0) {
+                $result['path'] .= '&jump=' . $type;
+            }
 
             # 生成各个端口的品牌入口:
             $result['code'] = $code;
@@ -50,15 +53,16 @@ class Info
             $result['web'] = '';
 
             # h5页面
-            $result['h5'] = $host . $path;
+            $result['h5'] = $host . $result['path'];
             # h5二维码码
             $result['h5_ercode'] = '';
             
-            # 0是频道首页,大于0是资源详情页
             $scene[0] = $info['code'];
             $scene[1] = $sales_type;
             $scene[2] = $sales_id;
             $scene[3] = $uid;
+
+            # 0是频道首页,大于0是资源详情页
             $scene[4] = $type;
             $scene = implode('!', $scene);
 

+ 5 - 1
src/place/set/manage/place.php

@@ -32,7 +32,7 @@ return [
         'upAdmin' => true,
         'desc' => '修改品牌信息请切换到相应品牌后到配置中修改',
         'tab' => [
-            '基本信息' => 'ercode,uid,name,info,code,password,price,logo,bg,content',
+            '基本信息' => 'ercode,uid,name,info,host,code,password,price,logo,bg,content',
             //'支付设置' => 'money_id',
         ],
         'field'    => [
@@ -97,6 +97,10 @@ return [
                 'desc' => '设置价格后,用户购买后才能进入',
             ],
 
+            'host' => [
+                'rules' => true,
+            ],
+
             
             'logo' => [
                 'type' => 'upload',

+ 5 - 0
src/place/set/table/info.php

@@ -51,6 +51,11 @@ return [
             'type'      => 'varchar(20)',
         ],
 
+        'host' => [
+            'name'      => '访问域名',
+            'type'      => 'varchar(200)',
+        ],
+
         'price' => [
             'name'      => '价格',
             'type'      => 'decimal(11,2)',

+ 2 - 1
src/place/source/app/Lib/Content.php

@@ -17,6 +17,7 @@ class Content
     # 获取内容列表
     public function getList($uid, $source_id, $channel_id, $cate_id = 0)
     {
+        $channel = Dever::db('psource/content_channel')->find($channel_id);
         $where['info_id'] = $source_id;
         $where['channel_id'] = $channel_id;
         if ($cate_id > 0) {
@@ -32,7 +33,7 @@ class Content
             foreach ($data as &$v) {
                 if (!$v['info'] && $v['content']) {
                     $v['content'] = strip_tags(htmlspecialchars_decode($v['content']));
-                    $v['info'] = mb_substr($v['content'], 0, 30, 'UTF-8');
+                    $v['info'] = mb_substr($v['content'], 0, 50, 'UTF-8');
                 }
                 unset($v['content']);
 

+ 1 - 1
src/place/source/app/Lib/Info.php

@@ -72,7 +72,7 @@ class Info
     # 获取资源详细信息
     public function getInfo($uid, $id)
     {
-        $info = Dever::db('psource/info')->find(['id' => $id, 'status' => 1], ['col' => 'id,name,info,price,sku_id,pic,content,channel_id,cate_parent_id,cate_id,have_vip,num_sell+num_sell_add as num_sell,show_page,show_submit,show_sell,show_content']);
+        $info = Dever::db('psource/info')->find(['id' => $id, 'status' => 1], ['col' => 'id,name,info,price,sku_id,pic,content,channel_id,cate_parent_id,cate_id,have_vip,num_sell+num_sell_add as num_sell,show_page,show_submit,show_sell']);
         if (!$info) {
             Dever::error('资源不存在');
         }

+ 5 - 1
src/place/source/manage/content_channel.php

@@ -10,10 +10,14 @@ return [
             'name' => [
                 'rules' => true,
             ],
+            /*
+            'show' => [
+                'rules' => true,
+                'type' => 'radio',
+            ],*/
             'sort' => [
                 'rules' => true,
                 'tip' => '正序排序',
-                'desc' => '“详情”的排序数字为0,默认排在最前面,',
             ],
             'status' => [
                 'rules' => true,

+ 9 - 0
src/place/source/table/content_channel.php

@@ -12,6 +12,15 @@ return [
             'name'      => '类别名称',
             'type'      => 'varchar(32)',
         ],
+        'show' => [
+            'name'      => '展示形式',
+            'type'      => 'tinyint(1)',
+            'default'   => 1,
+            'value'     => [
+                1 => '列表',
+                2 => '详情',
+            ],
+        ],
         'status' => [
             'name'      => '状态',
             'type'      => 'tinyint(1)',

+ 1 - 1
src/place/source/table/info.php

@@ -149,7 +149,7 @@ return [
         'show_sell' => [
             'name'      => '销量展示',
             'type'      => 'tinyint(1)',
-            'default'   => 1,
+            'default'   => 2,
             'value'     => [
                 1 => '显示',
                 2 => '不显示',

+ 1 - 1
src/place/user/manage/perk.php

@@ -8,7 +8,7 @@ return [
             ],
             'perk_code' => [
                 'name' => '兑换码',
-                'show' => 'Dever::call("Puser/Lib/perk.getCode", ["{perk_code_id}"])',
+                'show' => 'Dever::call("Puser/Lib/Perk.getCode", ["{perk_code_id}"])',
             ],
             'source',
             'total' => [