hrjy 2 tahun lalu
induk
melakukan
d961431339

+ 2 - 2
.constant

@@ -1,3 +1,3 @@
 <?php
-define('INSTALL_DATE',1578360044);
-define('SERIALNUMBER','N2L6Px');
+define('INSTALL_DATE',1650422610);
+define('SERIALNUMBER','xsu7IS');

+ 0 - 1
.example.env

@@ -1 +0,0 @@
-APP_DEBUG = true

[APP]
DEFAULT_TIMEZONE = Asia/Shanghai

[DATABASE]
TYPE = mysql
HOSTNAME = 127.0.0.1
DATABASE = test
USERNAME = username
PASSWORD = password
HOSTPORT = 3306
CHARSET = utf8
DEBUG = true

[LANG]
default_lang = zh-cn

+ 1 - 1
app/admin/controller/user/User.php

@@ -119,7 +119,7 @@ class User extends AuthController
         $f[] = Form::radio('money_status', '修改余额', 1)->options([['value' => 1, 'label' => '增加'], ['value' => 2, 'label' => '减少']]);
         $f[] = Form::number('money', '余额')->min(0);
         $f[] = Form::radio('integration_status', '修改积分', 1)->options([['value' => 1, 'label' => '增加'], ['value' => 2, 'label' => '减少']]);
-        $f[] = Form::number('integration', '积分')->min(0);
+        $f[] = Form::number('integration', '积分' )->min(0);
         $form = Form::make_post_form('修改其他', $f, Url::buildUrl('update_other', array('uid' => $uid)));
         $this->assign(compact('form'));
         return $this->fetch('public/form-builder');

+ 48 - 40
app/admin/model/system/SystemUserTask.php

@@ -42,53 +42,61 @@ class SystemUserTask extends BaseModel
      */
     protected static $TaskType = [
         [
-            'type' => 'SatisfactionIntegral',
-            'name' => '满足积分{$num}',
-            'real_name' => '积分数',
+            'type' => 'silver',
+            'name' => '购买200大米礼包',
+            'real_name' => '购买数',
             'max_number' => 0,
             'min_number' => 0,
-            'unit' => ''
+            'unit' => ''
         ],
         [
-            'type' => 'ConsumptionAmount',
-            'name' => '消费满{$num}',
-            'real_name' => '消费金额',
+            'type' => 'gold',
+            'name' => '购买1991大米礼包',
+            'real_name' => '购买数',
             'max_number' => 0,
             'min_number' => 0,
-            'unit' => '元'
-        ],
-        [
-            'type' => 'ConsumptionFrequency',
-            'name' => '消费{$num}',
-            'real_name' => '消费次数',
-            'max_number' => 0,
-            'min_number' => 0,
-            'unit' => '次'
-        ],
-        [
-            'type' => 'CumulativeAttendance',
-            'name' => '累计签到{$num}',
-            'real_name' => '累计签到',
-            'max_number' => 365,
-            'min_number' => 1,
-            'unit' => '天'
-        ],
-        [
-            'type' => 'InviteGoodFriends',
-            'name' => '邀请好友{$num}成为下线',
-            'real_name' => '邀请好友成为下线',
-            'max_number' => 1000,
-            'min_number' => 1,
-            'unit' => '人'
-        ],
-        [
-            'type' => 'InviteGoodFriendsLevel',
-            'name' => '邀请好友{$num}成为会员',
-            'real_name' => '邀请好友成为会员',
-            'max_number' => 1000,
-            'min_number' => 1,
-            'unit' => '人'
+            'unit' => '个'
         ],
+//        [
+//            'type' => 'ConsumptionAmount',
+//            'name' => '消费满{$num}',
+//            'real_name' => '消费金额',
+//            'max_number' => 0,
+//            'min_number' => 0,
+//            'unit' => '元'
+//        ],
+//        [
+//            'type' => 'ConsumptionFrequency',
+//            'name' => '消费{$num}',
+//            'real_name' => '消费次数',
+//            'max_number' => 0,
+//            'min_number' => 0,
+//            'unit' => '次'
+//        ],
+//        [
+//            'type' => 'CumulativeAttendance',
+//            'name' => '累计签到{$num}',
+//            'real_name' => '累计签到',
+//            'max_number' => 365,
+//            'min_number' => 1,
+//            'unit' => '天'
+//        ],
+//        [
+//            'type' => 'InviteGoodFriends',
+//            'name' => '邀请好友{$num}成为下线',
+//            'real_name' => '邀请好友成为下线',
+//            'max_number' => 1000,
+//            'min_number' => 1,
+//            'unit' => '人'
+//        ],
+//        [
+//            'type' => 'InviteGoodFriendsLevel',
+//            'name' => '邀请好友{$num}成为会员',
+//            'real_name' => '邀请好友成为会员',
+//            'max_number' => 1000,
+//            'min_number' => 1,
+//            'unit' => '人'
+//        ],
     ];
 
     public function profile()

+ 6 - 6
app/api/controller/AuthController.php

@@ -196,12 +196,12 @@ class AuthController
         } catch (ValidateException $e) {
             return app('json')->fail($e->getError());
         }
-        $verifyCode = CacheService::get('code_' . $account);
-        if (!$verifyCode)
-            return app('json')->fail('请先获取验证码');
-        $verifyCode = substr($verifyCode, 0, 6);
-        if ($verifyCode != $captcha)
-            return app('json')->fail('验证码错误');
+//        $verifyCode = CacheService::get('code_' . $account);
+//        if (!$verifyCode)
+//            return app('json')->fail('请先获取验证码');
+//        $verifyCode = substr($verifyCode, 0, 6);
+//        if ($verifyCode != $captcha)
+//            return app('json')->fail('验证码错误');
         if (strlen(trim($password)) < 6 || strlen(trim($password)) > 16)
             return app('json')->fail('密码必须是在6到16位之间');
         if ($password == '123456') return app('json')->fail('密码太过简单,请输入较为复杂的密码');

+ 1 - 0
app/api/controller/order/StoreOrderController.php

@@ -229,6 +229,7 @@ class StoreOrderController
                     break;
                 case 'yue':
                     if (StoreOrder::yuePay($orderId, $request->uid(), $formId))
+                        
                         return app('json')->status('success', '余额支付成功', $info);
                     else {
                         $errorinfo = StoreOrder::getErrorInfo();

+ 7 - 6
app/models/store/StoreOrder.php

@@ -376,7 +376,7 @@ class StoreOrder extends BaseModel
 
             //积分抵扣
             $res2 = true;
-            $SurplusIntegral = $userInfo['integral'];
+            $SurplusIntegral = $userInfo['voucher'];
             if ($payIntegral > 0) {
                 if ($userInfo['integral'] < $payIntegral) {
                     return self::setErrorInfo('积分不足', true);
@@ -394,20 +394,20 @@ class StoreOrder extends BaseModel
                     $payPrice = bcsub($payPrice, $deductionPrice, 2);
                     $usedIntegral = $SurplusIntegral;
                     $SurplusIntegral = 0;
-                    $res2 = false !== User::edit(['integral' => 0], $userInfo['uid'], 'uid');
+                    $res2 = false !== User::edit(['voucher' => 0], $userInfo['uid'], 'uid');
                 } else {
                     $deductionPrice = $payPrice;
                     $usedIntegral = (float)bcdiv($payPrice, $other['integralRatio'], 2);
                     $SurplusIntegral = bcsub($SurplusIntegral, $usedIntegral, 2);
-                    $res2 = false !== User::bcDec($userInfo['uid'], 'integral', $usedIntegral, 'uid');
+                    $res2 = false !== User::bcDec($userInfo['uid'], 'voucher', $usedIntegral, 'uid');
                     $payPrice = 0;
                 }
-                $res2 = $res2 && false != UserBill::expend('积分抵扣', $uid, 'integral', 'deduction', $usedIntegral, $key, $SurplusIntegral, '购买商品使用' . floatval($usedIntegral) . '积分抵扣' . floatval($deductionPrice) . '元');
+                $res2 = $res2 && false != UserBill::expend('抵扣券抵扣', $uid, 'voucher', 'sub_voucher', $usedIntegral, $key, $SurplusIntegral, '购买商品使用' . floatval($usedIntegral) . '抵用券抵扣' . floatval($deductionPrice) . '元');
             } else {
                 $deductionPrice = 0;
                 $usedIntegral = 0;
             }
-            if (!$res2) return self::setErrorInfo('使用积分抵扣失败!', true);
+            if (!$res2) return self::setErrorInfo('使用抵扣券抵扣失败!', true);
             if ($payPrice <= 0) $payPrice = 0;
             if ($test) {
                 self::rollbackTrans();
@@ -438,7 +438,8 @@ class StoreOrder extends BaseModel
                 'deduction_price' => $deductionPrice,
                 'paid' => 0,
                 'pay_type' => $payType,
-                'use_integral' => $usedIntegral + $payIntegral,
+                'use_integral' => 0,
+                'voucher' => $usedIntegral + $payIntegral,
                 'gain_integral' => $gainIntegral,
                 'mark' => htmlspecialchars($mark),
                 'combination_id' => $combinationId,

+ 57 - 0
app/models/system/SystemUserTask.php

@@ -3,6 +3,8 @@
 namespace app\models\system;
 
 use app\models\store\StoreOrder;
+use app\models\store\StoreOrderCartInfo;
+use app\models\store\StoreProduct;
 use app\models\user\User;
 use app\models\user\UserBill;
 use app\models\user\UserLevel;
@@ -99,6 +101,22 @@ class SystemUserTask extends BaseModel
             'min_number' => 1,
             'unit' => '人'
         ],
+        [
+            'type' => 'silver',
+            'name' => '购买200大米礼包',
+            'real_name' => '购买数',
+            'max_number' => 0,
+            'min_number' => 0,
+            'unit' => '个'
+        ],
+        [
+            'type' => 'gold',
+            'name' => '购买1991大米礼包',
+            'real_name' => '购买数',
+            'max_number' => 0,
+            'min_number' => 0,
+            'unit' => '个'
+        ],
     ];
 
     public function profile()
@@ -247,6 +265,45 @@ class SystemUserTask extends BaseModel
         return ['还需签到{$num}天', $sumCount, $isComplete];
     }
 
+    /**
+     * 购买200礼包
+     * @param $task_id
+     * @param $uid
+     * @param $start_time
+     * @param $number
+     * @return void
+     */
+    public static function silver($task_id, $uid = 0, $start_time = 0, $number = 0)
+    {
+        $isComplete = false;
+        $product = StoreProduct::where([['cate_id', '=', 53], ['price', '=', 200]])->value('id'); // 两百的礼包
+        $order = StoreOrder::where([['uid', '=', $uid], ['paid', '=', 1]])->column('id');
+        $orderInfo = StoreOrderCartInfo::where([['oid', 'in', $order], ['product_id', '=', $product]])->find();
+        if ($orderInfo) $isComplete = UserTaskFinish::setFinish($uid, $task_id) ? true : false;
+        return ['还需购买200礼包', $orderInfo,$isComplete];
+    }
+
+    /**
+     * 购买1991礼包
+     * @param $task_id
+     * @param $uid
+     * @param $start_time
+     * @param $number
+     * @return void
+     */
+    public static function gold($task_id, $uid = 0, $start_time = 0, $number = 0)
+    {
+        $isComplete = false;
+        $product = StoreProduct::where([['cate_id', '=', 53], ['price', '=', 1991]])->value('id'); // 两百的礼包
+        $order = StoreOrder::where([['uid', '=', $uid], ['paid', '=', 1]])->column('id');
+        $orderInfo = StoreOrderCartInfo::where([['oid', 'in', $order], ['product_id', '=', $product]])->find();
+        if ($orderInfo) $isComplete = UserTaskFinish::setFinish($uid, $task_id) ? true : false;
+        return ['还需购买1991礼包', $orderInfo,$isComplete];
+    }
+
+
+
+
     /**
      * 设置任务完成情况
      * @param int $task_id 任务id

+ 0 - 8
public/.htaccess

@@ -1,8 +0,0 @@
-<IfModule mod_rewrite.c>
-  Options +FollowSymlinks -Multiviews
-  RewriteEngine On
-
-  RewriteCond %{REQUEST_FILENAME} !-d
-  RewriteCond %{REQUEST_FILENAME} !-f
-  RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
-</IfModule>

+ 5 - 6
public/nginx.htaccess

@@ -1,6 +1,5 @@
-location / { 
-   if (!-e $request_filename) {
-   rewrite  ^(.*)$  /index.php?s=/$1  last;
-   break;
-    }
- }
+location / {
+        if (!-e $request_filename){
+                rewrite  ^(.*)$  /index.php?s=$1  last;   break;
+        }
+}