Kirin 3 年之前
父節點
當前提交
5d4c294ab8
共有 3 個文件被更改,包括 4 次插入40 次删除
  1. 1 33
      app/api/controller/PublicController.php
  2. 2 2
      app/common.php
  3. 1 5
      app/models/store/StoreOrder.php

+ 1 - 33
app/api/controller/PublicController.php

@@ -40,39 +40,7 @@ class PublicController
 
     public function test(Request $request)
     {
-//        BaseModel::beginTrans();
-//        try {
-//            $uid = $request->post('uid');
-//            $res = TreeRecommend::insertTree($uid, User::where('uid', $uid)->value('spread_uid'));
-//            $res = $res && self::pinkIntegral($uid);
-//            $res = $res && self::pinkRecommend($uid);
-//            if ($res) {
-//                BaseModel::commitTrans();
-//                return app('json')->success('成功');
-//            } else {
-//                BaseModel::rollbackTrans();
-//                return app('json')->fail('失败');
-//            }
-//        } catch (Exception $e) {
-//            BaseModel::rollbackTrans();
-//            return app('json')->fail($e->getMessage());
-//        }
-        $province = SystemCity::where('parent_id', 0)->where('level', 0)->select();
-        $res = [];
-        foreach ($province as $v) {
-            $city = SystemCity::where('parent_id', $v['city_id'])->where('level', 1)->select();
-            $citys = [];
-            foreach ($city as $vv) {
-                $children = SystemCity::where('parent_id', $vv['city_id'])->where('level', 2)->select();
-                $dis = [];
-                foreach ($children as $vvv) {
-                    $dis[] = ['value' => $vvv['name'], 'label' => $vvv['name']];
-                }
-                $citys[] = ['value' => $vv['name'], 'label' => $vv['name'], 'children' => $dis];
-            }
-            $res[] = ['value' => $v['name'], 'label' => $v['name'], 'children' => $citys];
-        }
-        @file_put_contents('city.js', 'window.province_city_area=' . json_encode($res));
+        StoreOrder::monthAward();
     }
 
     public static function pinkIntegral($uid)

+ 2 - 2
app/common.php

@@ -36,12 +36,12 @@ if (!function_exists('sys_config')) {
      * @param string $default
      * @return string
      */
-    function sys_config(string $name, $default = '')
+    function sys_config(string $name, $default = '', $catch = false)
     {
         if (empty($name))
             return $default;
 
-        $config = trim(app('sysConfig')->get($name));
+        $config = trim(app('sysConfig')->get($name, $default, $catch));
         if ($config === '' || $config === false) {
             return $default;
         } else {

+ 1 - 5
app/models/store/StoreOrder.php

@@ -2335,14 +2335,10 @@ class StoreOrder extends BaseModel
         $uids = TreeRecommend::where('get', 0)
             ->whereTime('add_time', 'last month')
             ->column('uid');
-        $month_award_ratio = sys_config('month_award_ratio', 0);
+        $month_award_ratio = sys_config('month_award_ratio', 0, true);
         $orders = self::where('status', '>=', 2)
             ->where('paid', 1)
             ->where('is_del', 0)
-            ->where('combination_id', 0)
-            ->where('seckill_id', 0)
-            ->where('bargain_id', 0)
-            ->where('shipping_type', 1)
             ->where('is_system_del', 0)
             ->whereTime('pay_time', 'last month')
             ->where('refund_status', 0)