1557492053 3 years ago
parent
commit
641da71a1a

+ 5 - 5
.env

@@ -5,15 +5,15 @@ DEFAULT_TIMEZONE = Asia/Shanghai
 
 [DATABASE]
 TYPE = mysql
-HOSTNAME = 8.219.191.124
+HOSTNAME = 127.0.0.1
 DATABASE = yuanzhongxiu
-USERNAME = yuanzhongxiu
-PASSWORD = WPDrmPREz36y6mMb
+USERNAME = root
+PASSWORD = root
 HOSTPORT = 3306
 CHARSET = utf8
 DEBUG = true
 prefix = erp_
-
+gg = 8.219.191.124WPDrmPREz36y6mMb
 [LANG]
 default_lang = zh-cn
 
@@ -25,4 +25,4 @@ host = 118.195.195.200
 port = 6379
 password = 123456
 timeout = 1000
-select = 10
+select = 15

+ 2 - 2
app/BaseService.php

@@ -8,10 +8,10 @@ class BaseService
 {
 
     protected function ok($data = null) {
-        return ['code' => 200, 'message' => null, 'data' => $data];
+        return new \SResult(true,null, $data);
     }
 
     protected function fail($message) {
-        return ['code' => 205, 'message' => $message, "data" => null];
+        return new \SResult(false,$message,null);
     }
 }

+ 5 - 0
app/Request.php

@@ -5,4 +5,9 @@ namespace app;
 class Request extends \think\Request
 {
 
+    function setData($admin_id,$admin_name) {
+        $this->param['admin_id'] = $admin_id;
+        $this->param['admin_name'] = $admin_name;
+    }
+
 }

+ 14 - 2
app/admin/controller/Activity.php

@@ -52,6 +52,8 @@ class Activity extends BaseController
                         'type' => $params['types'][$i],
                         'discount' => $params['discounts'][$i],
                         'reduced_price' => $params['reduced_prices'][$i],
+                        'start_time' => strtotime($params['start_time']),
+                        'end_time' => strtotime($params['end_time'])
                     ]);
                 }
             }
@@ -74,6 +76,10 @@ class Activity extends BaseController
                            'start_time'  => strtotime($params['start_time']),
                            'end_time'  =>  strtotime($params['end_time']),
                        ]);
+                       $this->activityProductModel->where("activity_id", $activity->id)->update([
+                           'start_time' => strtotime($params['start_time']),
+                           'end_time' => strtotime($params['end_time'])
+                       ]);
                        return $this->ok(true);
                    }
                    return $this->fail(lang("Fail"));
@@ -91,6 +97,7 @@ class Activity extends BaseController
         if(!isset($params['ids']))
             return $this->fail(lang("Please select the data you want to delete"));
         $this->activityModel->deleteByIds(explode(',', $params['ids']));
+        $this->activityProductModel->where("activity_id", 'in', explode(',', $params['ids']))->update(['is_delete' => 1]);
         return $this->ok(true);
     }
 
@@ -105,15 +112,20 @@ class Activity extends BaseController
     public function add_relation() {
         $params = $this->request->param();
         if(isset($params['product_id'])) {
-            $relation = $this->activityProductModel->doesItExist($params['product_id']);
-            if($relation && $relation->id != $params['id'])
+            $relation = $this->activityProductModel->doesItExist($params['activity_id'], $params['product_id']);
+            if($relation && $relation->id != $params['product_id'])
                 return $this->fail("Fail to add. Data duplication");
+            $activity = $this->activityModel->findById($params['activity_id']);
+            if(!$activity)
+                return $this->fail("Add fail");
             $this->activityProductModel->save([
                 'activity_id' => $params['activity_id'],
                 'product_id' => $params['product_id'],
                 'type' => $params['type'],
                 'discount' => $params['discount'],
                 'reduced_price' => $params['reduced_price'],
+                'start_time' => $activity->start_time,
+                'end_time' => $activity->end_time
             ]);
         }
         return $this->ok(true);

+ 3 - 3
app/admin/controller/Login.php

@@ -31,9 +31,9 @@ class Login extends BaseController
      */
     public function login(Request $request) {
         $params = (new LoginValidate())->requestBodyCheck($request);
-        $body = $this->service->login($params['username'], $params['password']);
-        predicate($body['code'] == 200, $body['message']);
-        return json($body);
+        $s_result = $this->service->login($params['username'], $params['password']);
+        predicate($s_result->bool, $s_result->message);
+        return $this->ok($s_result->data);
     }
 
 }

+ 0 - 0
app/api/common.php


+ 29 - 0
app/api/controller/Admin.php

@@ -0,0 +1,29 @@
+<?php
+
+
+namespace app\api\controller;
+
+
+use app\api\service\AdminService;
+use app\BaseController;
+use app\Request;
+use think\App;
+
+class Admin extends BaseController
+{
+    private $service;
+
+    public function __construct(App $app)
+    {
+        $this->service = new AdminService();
+        parent::__construct($app);
+    }
+
+    public function search(Request $request) {
+        $params = $request->param();
+        $res = $this->service->search(format_string($params['text'] ?? null));
+        return $this->ok($res);
+    }
+
+
+}

+ 53 - 0
app/api/controller/Customer.php

@@ -0,0 +1,53 @@
+<?php
+
+
+namespace app\api\controller;
+
+
+use app\api\service\CustomerService;
+use app\api\validate\AddCustomerValidate;
+use app\api\validate\LoginValidate;
+use app\common\model\CustomerModel;
+use app\Request;
+use think\App;
+
+class Customer extends \app\BaseController
+{
+
+    private $service;
+
+    public function __construct(App $app)
+    {
+        $this->service = new CustomerService();
+        parent::__construct($app);
+    }
+
+    public function add(Request $request) {
+        $params = (new AddCustomerValidate())->message([
+            'name_zh.require'   =>  lang("The customer name_zh does not comply with the rule"),
+            'name_en.require'   =>  lang("The customer name_en does not comply with the rule"),
+            'mobile.require'    =>  lang("The mobile does not comply with the rule"),
+            'address.require'   =>  lang("The address does not comply with the rule"),
+            'email.email'     =>  lang("The email does not comply with the rule"),
+            'sex.require'       =>  lang("The sex does not comply with the rule"),
+            'linkman.require'       =>  lang("The linkman does not comply with the rule"),
+            'zue_coin.require'       =>  lang("The zue_coin does not comply with the rule"),
+            'sun_calendar.require'       =>  lang("The sun_calendar does not comply with the rule"),
+            'lunar_calendar.require'       =>  lang("The lunar_calendar does not comply with the rule"),
+        ])->requestBodyCheck($request);
+        $res = $this->service->add($params);
+        predicate($res->bool, $res->message);
+        return $this->ok($res->data);
+    }
+
+
+
+
+
+
+
+
+
+
+
+}

+ 0 - 18
app/api/controller/Demo.php

@@ -1,18 +0,0 @@
-<?php
-
-namespace app\api\controller;
-
-use app\BaseController;
-
-class Demo extends BaseController
-{
-    public function index()
-    {
-        return $this->ok(["hello" =>'123', "io" => "/"]);
-    }
-
-    public function hello($name = 'ThinkPHP6')
-    {
-        return 'hello,' . $name;
-    }
-}

+ 48 - 4
app/api/controller/Login.php

@@ -2,17 +2,61 @@
 
 namespace app\api\controller;
 
+use app\api\service\LoginService;
+use app\api\validate\LoginValidate;
 use app\BaseController;
+use app\Request;
+use think\App;
 
 class Login extends BaseController
 {
-    public function index()
+
+    private $service;
+
+    public function __construct(App $app)
     {
-        return "1111";
+        $this->service = new LoginService();
+        parent::__construct($app);
     }
 
-    public function hello($name = 'ThinkPHP6')
+    /**
+     * @param Request $request
+     * @return \think\response\Json
+     * @throws \app\exception\BaseException
+     */
+    public function login(Request $request)
     {
-        return 'hello,' . $name;
+        $params = (new LoginValidate())->message([
+            'username.require' => lang('The user name must exist'),
+            'username.max' => lang('The length of the user name is invalid'),
+            'password.require' => lang('The password must exist'),
+            'password.max' => lang('The length of the password is invalid'),
+        ])->requestBodyCheck($request);
+        $res = $this->service->loadByLogin($params['username'], md5($params['password']));
+        predicate($res->bool, $res->message);
+        return $this->ok($res->data);
     }
+
 }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 34 - 0
app/api/controller/Product.php

@@ -0,0 +1,34 @@
+<?php
+
+
+namespace app\api\controller;
+
+
+use app\api\service\ProductService;
+use app\BaseController;
+use app\Request;
+use think\App;
+
+class Product extends BaseController
+{
+    private $service;
+    public function __construct(App $app)
+    {
+        $this->service = new ProductService();
+        parent::__construct($app);
+    }
+
+    public function search(Request $request) {
+        $params = $request->param();
+        predicate(isset($params['store_id']) && $params['store_id'] > 0, lang('Store information does not exist'));
+        $res = $this->service->search(
+            $params['store_id'],
+            format_string($params['bar_code'] ?? null),
+            format_string($params['product_name'] ?? null),
+            $params['page'] ?? 1,
+            $params['size'] ?? 10
+        );
+        return $this->ok($res);
+    }
+
+}

+ 6 - 0
app/api/lang/en-us.php

@@ -0,0 +1,6 @@
+<?php
+
+
+return [
+
+];

+ 78 - 0
app/api/lang/zh-cn.php

@@ -0,0 +1,78 @@
+<?php
+
+return [
+    'Yes'   => '是',
+    'No'    => '否',
+    'add'       => '新增',
+    'delete'    => '删除',
+    'edit'      => '编辑',
+    'condition' => '条件',
+    'search'    => '搜索',
+    'operation' => '操作',
+    'select'    => '查看',
+    'Reset'     => '重置',
+    'Confirm'   => '确定',
+    'Submit'    => '提交',
+    'Succeed'   => '成功',
+    'Warn'      =>  '提醒',
+    'Update'    =>  '更新',
+    'Base'      =>  '基础',
+    'Info'      =>  '信息',
+    'Rest'      =>  '其他',
+    'Sort'      =>  '排序',
+    'Rule'      =>  '角色',
+    'Type'      =>  '类型',
+    'The account password is incorrect'     =>  '账号密码不正确',
+    "Background permission is not set"  => "后台未设置权限",
+    "The role group does not exist" => "角色组不存在",
+    "The user name must exist" => "用户名必须存在",
+    "The length of the user name is invalid" => "用户名长度不符合条件",
+    "Failed to obtain token"    =>  "获取token失败",
+    "Store information does not exist" =>  "门店信息不存在",
+    "The customer name_en does not comply with the rule" => "客户英文名称不符合规则",
+    "The customer name_zh does not comply with the rule" => "客户中文名称不符合规则",
+    'The mobile does not comply with the rule'    =>  "客户手机不符合规则",
+    'The address does not comply with the rule'   =>  "客户地址不符合规则",
+    'The email does not comply with the rule'     =>  "客户邮箱不符合规则",
+    'The sex does not comply with the rule'       =>  "客户性别不符合规则",
+    'The linkman does not comply with the rule'       =>  "客户联系人不符合规则",
+    'The zue_coin does not comply with the rule'       =>  "御龙币不符合规则",
+    'The sun_calendar does not comply with the rule'       =>  "阳历不符合规则",
+    'The lunar_calendar does not comply with the rule'       =>  "阴历不符合规则",
+    "Please enter the Zue Coin expiration time" =>  "请填写御龙币失效时间",
+];
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 2 - 1
app/api/middleware.php

@@ -1,5 +1,6 @@
 <?php
 // 全局中间件定义文件
 return [
-//    \app\common\middleware\FormatResponse::class,
+    \think\middleware\LoadLangPack::class,
+    \app\common\middleware\VerifySign::class,
 ];

+ 22 - 0
app/api/route/app.php

@@ -0,0 +1,22 @@
+<?php
+namespace app\api\route;
+
+use think\facade\Route;
+
+Route::post('api/login','api/login/login');
+
+
+
+Route::group('api/product', function () {
+    Route::rule('search', 'api/product/search');
+})->middleware(\app\common\middleware\VerifySessionToken::class);
+
+
+Route::group('api/customer', function () {
+    Route::rule('add', 'api/customer/add');
+})->middleware(\app\common\middleware\VerifySessionToken::class);
+
+Route::group('api/user', function () {
+    Route::rule('search', 'api/admin/search');
+})->middleware(\app\common\middleware\VerifySessionToken::class);
+

+ 47 - 0
app/api/service/AdminService.php

@@ -0,0 +1,47 @@
+<?php
+
+
+namespace app\api\service;
+
+
+use app\common\model\AdminModel;
+use app\common\model\StoreModel;
+
+class AdminService extends \app\BaseService
+{
+
+    private $adminModel;
+    private $storeModel;
+
+    public function __construct()
+    {
+        $this->adminModel = new AdminModel();
+        $this->storeModel = new StoreModel();
+    }
+
+    public function search($text = null) {
+        $admins = $this->adminModel->findAdmins($text)->toArray();
+        $store_ids = [];
+
+        foreach ($admins as &$admin) {
+            $admin['store_ids'] = $admin['store_ids'] ? explode(',', $admin['store_ids']) : [];
+            $store_ids = array_unique(array_merge($store_ids, $admin['store_ids']));
+        }
+
+        $stores = $this->storeModel->findByIds($store_ids)->toArray();
+        $fmt_stores = [];
+        foreach ($stores as $store) {
+            $fmt_stores[$store['id']] = $store;
+        }
+        foreach ($admins as &$admin) {
+            $now_stores = array_map(function ($store_id) use ($fmt_stores){
+                return $fmt_stores[$store_id];
+            }, $admin['store_ids']);
+
+            $admin['stores'] = $now_stores;
+        }
+        return $admins;
+    }
+
+
+}

+ 73 - 0
app/api/service/CustomerService.php

@@ -0,0 +1,73 @@
+<?php
+
+namespace app\api\service;
+
+use app\BaseService;
+use app\common\model\AdminModel;
+use app\common\model\CustomerModel;
+use app\common\model\CustomerZueCoinModel;
+use app\common\model\StoreModel;
+use app\common\model\ZueCoinRecordModel;
+
+class CustomerService extends BaseService
+{
+    private $customerModel;
+    private $adminModel;
+    private $storeModel;
+    private $customerZueCoinModel;
+    private $zueCoinRecordModel;
+
+    public function __construct()
+    {
+        $this->customerModel = new CustomerModel();
+        $this->adminModel = new AdminModel();
+        $this->storeModel = new StoreModel();
+        $this->customerZueCoinModel = new CustomerZueCoinModel();
+        $this->zueCoinRecordModel = new ZueCoinRecordModel();
+    }
+
+    public function add(array $params) {
+        $isExist = $this->customerModel->doesItExist($params['mobile']);
+        if ($isExist)
+            return $this->fail(lang("Fail to add. Data duplication"));
+        if(isset($params['follow_user_id'])) {
+            $follow_user = $this->adminModel->findById($params['follow_user_id']);
+            if (!$follow_user)
+                return $this->fail(lang("The employees dont exist"));
+            $params['follow_username'] = $follow_user->nickname;
+        }
+        if(isset($params['store_id'])) {
+            $store = $this->storeModel->findById($params['store_id']);
+            if(!$store)
+                return $this->fail(lang("Stores do not exist"));
+            $params['store_abbr'] = $store->abbr;
+        }
+        $params['create_user_id'] =$params['admin_id'];
+        $params['create_username'] = $params['admin_name'];
+        $params['create_time'] = time();
+        $params['update_time'] = time();
+        $customer = $this->customerModel->create($params);
+        if(isset($params['zue_coin']) && $params['zue_coin'] > 0) {
+            if (!isset($params['lose_time']))
+                return  $this->fail(lang("Please enter the Zue Coin expiration time"));
+            $zueCoin = $this->customerZueCoinModel->create([
+                'customer_id' => $customer->id,
+                'zue_coin' => $params['zue_coin'],
+                'lose_time' => strtotime($params['lose_time']),
+                'create_time' => time(),
+                'update_time' => time()
+            ]);
+            $this->zueCoinRecordModel->save([
+                'zue_coin_id'   =>  $zueCoin->id,
+                'origin'    => 0,
+                'change'    =>  $params['zue_coin'],
+                'after'     =>  $params['zue_coin'],
+                'reason'    =>  2,
+                'create_time' => time(),
+                'update_time' => time()
+            ]);
+            $customer['zue_coin'] = $zueCoin;
+        }
+        return $this->ok($customer->id);
+    }
+}

+ 87 - 0
app/api/service/LoginService.php

@@ -0,0 +1,87 @@
+<?php
+
+
+namespace app\api\service;
+
+
+use app\BaseService;
+use app\common\model\AdminModel;
+use app\common\model\AuthGroupAccessModel;
+use app\common\model\AuthGroupModel;
+use app\common\model\StoreModel;
+use think\facade\Cache;
+
+class LoginService extends BaseService
+{
+    private $model;
+    private $storeModel;
+    private $groupModel;
+    private $groupAccessModel;
+
+    public function __construct()
+    {
+        $this->model = new AdminModel();
+        $this->groupModel = new AuthGroupModel();
+        $this->storeModel = new StoreModel();
+        $this->groupAccessModel = new AuthGroupAccessModel();
+    }
+
+    public function loadByLogin($username, $password) {
+        $admin = $this->model->loadByLogin($username,$password);
+        if (!$admin)
+            return $this->fail(lang('The account password is incorrect'));
+        $access = $this->groupAccessModel->findByAdminId($admin->id);
+        if (!$access)
+            return $this->fail(lang('Background permission is not set'));
+        $group = $this->groupModel->findById($access->group_id);
+        if (!$group)
+            return $this->fail(lang('The role group does not exist'));
+        $stores = $this->storeModel->findByIds($admin->store_ids ? explode(',', $admin->store_ids) : []);
+        $admin['group'] = $group;
+        $admin['stores'] = $stores;
+        $token = \Jwt::getToken([
+            'iss'=>'jwt_user',  //该JWT的签发者
+            'iat'=>time(),  //签发时间
+            'exp'=>time()+7200*7,  //过期时间
+            'nbf'=>time(),  //该时间之前不接收处理该Token
+            'jti'=>md5(uniqid('JWT').time()),  //该Token唯一标识
+            'admin_id' => $admin->id,
+            'account' => $admin->account,
+            'nickname' => $admin->nickname,
+            'group_id' => $group->id,
+            'group_name' => $group->name,
+        ]);
+        if($token === false) return $this->fail(lang('Failed to obtain token'));
+        $admin->token = $token;
+//        $redis = Cache::store('redis')->handler();  //返回句柄对象,可执行其它高级方法
+//        $sadd = $redis->sadd('user:infos', $token);
+        $refreshToken = $this->model->refreshToken($admin->id, $token);
+        return $refreshToken ?  $this->ok($admin) : $this->fail("Fail");
+    }
+
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 83 - 0
app/api/service/ProductService.php

@@ -0,0 +1,83 @@
+<?php
+
+
+namespace app\api\service;
+
+
+use app\BaseService;
+use app\common\model\ActivityProductModel;
+use app\common\model\ConfigModel;
+use app\common\model\ProductModel;
+use app\common\model\StoreProductModel;
+
+class ProductService extends BaseService
+{
+
+    private $productModel;
+    private $storeProductModel;
+    private $activityProductModel;
+    private $configModel;
+
+
+    public function __construct()
+    {
+        $this->productModel = new ProductModel();
+        $this->configModel = new ConfigModel();
+        $this->storeProductModel = new StoreProductModel();
+        $this->activityProductModel = new ActivityProductModel();
+    }
+
+    public function search($store_id,$bar_code = null, $product_name = null, $page = 1, $size = 10) {
+        $storeProducts = $this->storeProductModel->search([
+            'store_id' => $store_id,
+            'bar_code' => $bar_code,
+            'product_name' => $product_name,
+            'page' => $page,
+            "size" => $size
+        ]);
+        $items = $storeProducts->items();
+        $config = $this->configModel->findConfig();
+        $productIds = array_map(function ($data) {
+            return $data['product_id'];
+        }, $items);
+        $activityProducts = $this->activityProductModel->fetchByProductIds($productIds)->toArray();
+        foreach ($items as &$item) {
+            $aProducts = array_filter($activityProducts, function ($aProduct) use ($item) {
+                return $aProduct['product_id'] == $item['product_id'];
+            });
+            $res = $this->compare($item['product']['real_price'] ?? 0, $aProducts);
+            $item['product']['real_price'] = fixed2Float($res['min_num']);
+            $item['activity'] = $res['item'];
+            $item['product']['tax_rate'] = $item['product']['tax_rate'] > 0 ? $item['product']['tax_rate'] : $config->tax_rate;
+        }
+        return [$items, $storeProducts->total()];
+    }
+
+
+    private function compare($num, $array) {
+        $min_num = $num;
+        $index = null;
+        if($num > 0) {
+            foreach ($array as $key => $el) {
+                $now_price = $num;
+                if($el['type'] == 1) {
+                    $now_price = $num - $el['reduced_price'];
+                } else {
+                    if($el['discount'] > 0) {
+                        $now_price = $num - ($num * ($el['discount'] / 100));
+                    }
+                }
+                if($min_num == null) {
+                    $min_num = $now_price;
+                } else {
+                    if($now_price < $min_num) {
+                        $min_num = $now_price;
+                        $index = $key;
+                    }
+                }
+            }
+        }
+        return ['min_num' => $min_num, 'item' => $index == null ? null : $array[$index]];
+    }
+
+}

+ 27 - 0
app/api/validate/AddCustomerValidate.php

@@ -0,0 +1,27 @@
+<?php
+
+
+namespace app\api\validate;
+
+
+class AddCustomerValidate extends \app\common\validate\BaseValidate
+{
+
+    protected $rule = [
+        'name_zh'   =>  'require|max:25',
+        'name_en'   =>  'require|max:16',
+        'mobile'    =>  'require',
+        'address'   =>  'require',
+        'email'     =>  'email',
+        'sex'       =>  'require',
+        'linkman'       =>  'require',
+        'zue_coin'       =>  'require|number',
+        'sun_calendar'       =>  'require',
+        'lunar_calendar'       =>  'require',
+    ];
+
+
+
+
+
+}

+ 16 - 0
app/api/validate/LoginValidate.php

@@ -0,0 +1,16 @@
+<?php
+
+
+namespace app\api\validate;
+
+
+use app\common\validate\BaseValidate;
+
+class LoginValidate extends BaseValidate
+{
+    protected $rule = [
+        'username'  => 'require|max:25',
+        'password'  => 'require|max:16',
+    ];
+
+}

+ 23 - 0
app/api/validate/SearchProductValidate.php

@@ -0,0 +1,23 @@
+<?php
+
+
+namespace app\api\validate;
+
+
+use app\common\validate\BaseValidate;
+
+class SearchProductValidate extends BaseValidate
+{
+    protected $rule = [
+        'product_name'  => 'require|max:25',
+        'bar_code'  => 'require|max:16',
+    ];
+
+    protected $message = [
+        'username.require' => '用户名必须存在',
+        'username.max' => '用户名长度必须小于25',
+        'password.require' => '用户密码长度必须小于25',
+        'password.max' => '用户密码长度必须小于25',
+    ];
+
+}

+ 3 - 1
app/common.php

@@ -63,7 +63,9 @@ function seek($array, $id) {
     return $return;
 }
 
-
+function fixed2Float($number) {
+    return number_format(sprintf("%.2f",substr(sprintf("%.3f", $number), 0, -2)));
+}
 
 
 

+ 70 - 0
app/common/middleware/VerifySessionToken.php

@@ -0,0 +1,70 @@
+<?php
+
+
+namespace app\common\middleware;
+
+
+use app\exception\BaseException;
+use app\Request;
+use think\facade\Cache;
+
+class VerifySessionToken
+{
+    /**
+     * @param $request
+     * @param \Closure $next
+     * @return mixed
+     * @throws BaseException
+     */
+    public function handle(Request $request, \Closure $next)
+    {
+        $params = $request->param();
+//        if (isset($params['__TEST__']) && $params['__TEST__'] == __TEST__)
+//            return $next($request);
+        predicate(isset($params['session_token']),'session_token err');
+        $redis = Cache::store('redis')->handler();  //返回句柄对象,可执行其它高级方法
+        $is_exist = $redis->sismember('user:infos', $params['session_token']);
+        predicate(!$is_exist, '未登录', 403);
+        $jwt = \Jwt::verifyToken($params['session_token']);
+        if($jwt == false) {
+            $redis->srem('user:infos', $params['session_token']);
+            predicate(false, '登录失效');
+        }
+        $request->setData($jwt['admin_id'], $jwt['nickname']);
+        return $next($request);
+    }
+
+
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 59 - 0
app/common/middleware/VerifySign.php

@@ -0,0 +1,59 @@
+<?php
+
+
+namespace app\common\middleware;
+
+
+use app\exception\BaseException;
+
+const __TEST__ = '!(FAXKJSDdi101-fjLQ91hvl~@#$-we13';
+
+class VerifySign
+{
+    /**
+     * @param $request
+     * @param \Closure $next
+     * @return mixed
+     * @throws BaseException
+     */
+    public function handle($request, \Closure $next)
+    {
+        $params = $request->param();
+        $is_open = true;
+        if(!$is_open || (isset($params['__TEST__']) && $params['__TEST__'] == __TEST__))
+            return $next($request);
+        predicate(isset($params['sign']),'sign err');
+        $sign = $this->signature($params);
+        predicate($sign == $params['sign'],'verify sign err');
+        return $next($request);
+    }
+
+    function joint(array $obj, $ignoreSign = true) {
+        $keys = array_keys($obj);
+        asort($keys);
+        $str = '';
+        foreach ($keys as $key) {
+            if ($key != 'sign') {
+                $str .= strlen($str) > 0 ? '&' : '';
+                $value = $obj[$key];
+                if (is_array($value)) {
+                    $str .= $key."=".join(',', $value);
+                } else if(is_object($value)) {
+                    $str .= $this->joint($value);
+                } else {
+                    $str .= $key."=".$value;
+                }
+            }
+        }
+        return $str;
+    }
+
+    function signature(array $obj) {
+        $string = 'oj)$&!@'.$this->joint($obj).'@#jfanb*(.';
+        return md5($string);
+    }
+
+}
+
+
+

+ 11 - 1
app/common/model/ActivityProductModel.php

@@ -19,12 +19,22 @@ class ActivityProductModel extends BaseModel
         return $this->hasOne(ProductModel::class,'id','product_id');
     }
 
-    public function doesItExist($product_id) {
+    public function doesItExist($activity_id,$product_id) {
         return $this->where([
             ["product_id", '=', $product_id],
+            ["activity_id", '=', $activity_id],
             ["is_delete", '=', 0]
         ])->find();
     }
 
+    public function fetchByProductIds(array $p_ids) {
+        return $this->where([
+            ['is_delete', '=', 0],
+            ['product_id', 'in', $p_ids],
+            ['start_time', '<=', time()],
+            ['end_time', '>=', time()],
+        ])->select();
+    }
+
 
 }

+ 29 - 3
app/common/model/AdminModel.php

@@ -35,7 +35,7 @@ class AdminModel extends BaseModel
 
     public function loadByLogin($username, $password) {
         return $this->where([
-            ['account|id', '=', $username],
+            ['account|id|mobile', '=', $username],
             ['password', '=', $password],
             ['is_delete', '=',0]
         ])->find();
@@ -85,7 +85,33 @@ class AdminModel extends BaseModel
     }
 
     public function findAdmins($text) {
-        return $this->where('id|nickname','like', '%'.$text.'%')->select();
+        $where = [
+            ['is_delete', '=', 0]
+        ];
+        if($text != null) {
+            array_push($where,['id|nickname','like', '%'.$text.'%']);
+        }
+        return $this->where($where)->limit(20)->order('id', 'desc')->select();
     }
 
-}
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 5 - 0
app/common/model/ConfigModel.php

@@ -12,4 +12,9 @@ class ConfigModel extends BaseModel
     {
         // TODO: Implement genSchema() method.
     }
+
+    public function findConfig() {
+        return $this->findById(1);
+    }
+
 }

+ 3 - 2
app/common/model/ProductModel.php

@@ -51,8 +51,6 @@ class ProductModel extends BaseModel
         return $this->where('is_delete', 0)->where($or_where)->page(1,10)->select();
     }
 
-
-
     public function doesItExist($bar_code) {
         $customer = $this->where([
             ["bar_code", '=', $bar_code],
@@ -61,4 +59,7 @@ class ProductModel extends BaseModel
         return $customer ? true : false;
     }
 
+
+
+
 }

+ 19 - 2
app/common/model/StoreProductModel.php

@@ -18,12 +18,12 @@ class StoreProductModel extends BaseModel
      */
     public function store()
     {
-        return self::hasOne(StoreModel::class,'id','store_id');
+        return self::hasOne(StoreModel::class,'id','store_id')->where('is_delete', 0);
     }
 
     public function product()
     {
-        return self::hasOne(ProductModel::class,'id','product_id');
+        return self::hasOne(ProductModel::class,'id','product_id')->where('is_delete', 0);
     }
 
     public function doesItExist($store_id, $product_id) {
@@ -66,5 +66,22 @@ class StoreProductModel extends BaseModel
     }
 
 
+    public function search(array $params) {
+        $where = [
+            ['is_delete', '=', 0],
+            ['store_id', '=', $params['store_id']]
+        ];
+        if($params['bar_code'])
+            array_push($where, ['product_bar_code', 'like', '%'.$params['bar_code'].'%']);
+        if($params['product_name'])
+            array_push($where, ['product_name', 'like', '%'.$params['product_name'].'%']);
+
+        return $this->where($where)
+            ->with('product')
+            ->page($params['page'])
+            ->paginate($params['size'] ?? 10);
+    }
+
+
 
 }

+ 2 - 3
app/middleware.php

@@ -4,8 +4,7 @@ return [
     // 全局请求缓存
     // \think\middleware\CheckRequestCache::class,
     // 多语言加载
-    // \think\middleware\LoadLangPack::class,
+     \think\middleware\LoadLangPack::class,
     // Session初始化
-     \think\middleware\SessionInit::class
-
+     \think\middleware\SessionInit::class,
 ];

+ 11 - 11
config/cache.php

@@ -6,7 +6,7 @@
 
 return [
     // 默认缓存驱动
-    'default' => env('cache.driver', 'file'),
+    'default' => env('cache.driver', 'redis'),
 
     // 缓存连接方式配置
     'stores'  => [
@@ -24,16 +24,16 @@ return [
             // 序列化机制 例如 ['serialize', 'unserialize']
             'serialize'  => [],
         ],
-//        'redis'   =>  [
-//            // 驱动方式
-//            'type'   => 'redis',
-//            // 服务器地址
-//            'host'       => env('redis.host', '118.195.195.200'),
-//            "port" => env('redis.port', 6379),
-//            "password" => env('redis.password', '123456'),
-//            "timeout" => env('redis.timeout', 1000),
-//            "select" => env('redis.select', 10),
-//        ],
+        'redis'   =>  [
+            // 驱动方式
+            'type'   => 'redis',
+            // 服务器地址
+            'host'       => env('redis.host', '118.195.195.200'),
+            "port" => env('redis.port', 6379),
+            "password" => env('redis.password', '123456'),
+            "timeout" => env('redis.timeout', 1000),
+            "select" => env('redis.select', 15),
+        ],
         // 更多的缓存连接
 
     ],

+ 16 - 0
extend/SResult.php

@@ -0,0 +1,16 @@
+<?php
+
+
+class SResult
+{
+    public $bool = true;
+    public $message = null;
+    public $data = null;
+
+    public function __construct($bool,$message,$data)
+    {
+        $this->bool = $bool;
+        $this->message = $message;
+        $this->data = $data;
+    }
+}

+ 24 - 0
public/api.php

@@ -0,0 +1,24 @@
+<?php
+// +----------------------------------------------------------------------
+// | ThinkPHP [ WE CAN DO IT JUST THINK ]
+// +----------------------------------------------------------------------
+// | Copyright (c) 2006-2019 http://thinkphp.cn All rights reserved.
+// +----------------------------------------------------------------------
+// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
+// +----------------------------------------------------------------------
+// | Author: liu21st <liu21st@gmail.com>
+// +----------------------------------------------------------------------
+
+// [ 应用入口文件 ]
+namespace think;
+
+require __DIR__ . '/../vendor/autoload.php';
+
+// 执行HTTP应用并响应
+$http = (new App())->http;
+
+$response = $http->name('api')->run();
+
+$response->send();
+
+$http->end($response);

+ 2 - 2
route/app.php

@@ -13,5 +13,5 @@ use think\facade\Route;
 Route::get('think', function () {
     return 'hello,ThinkPHP6!';
 });
-
-Route::get('hello/:name', 'index/hello');
+Route::rule('/api/login','api/login/login')
+    ->middleware(\app\common\middleware\VerifySessionToken::class);

+ 5 - 0
vendor/bin/var-dump-server.bat

@@ -0,0 +1,5 @@
+@ECHO OFF
+setlocal DISABLEDELAYEDEXPANSION
+SET BIN_TARGET=%~dp0/var-dump-server
+SET COMPOSER_RUNTIME_BIN_DIR=%~dp0
+php "%BIN_TARGET%" %*

+ 352 - 0
vendor/composer/InstalledVersions.php

@@ -0,0 +1,352 @@
+<?php
+
+/*
+ * This file is part of Composer.
+ *
+ * (c) Nils Adermann <naderman@naderman.de>
+ *     Jordi Boggiano <j.boggiano@seld.be>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer;
+
+use Composer\Autoload\ClassLoader;
+use Composer\Semver\VersionParser;
+
+/**
+ * This class is copied in every Composer installed project and available to all
+ *
+ * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
+ *
+ * To require its presence, you can require `composer-runtime-api ^2.0`
+ *
+ * @final
+ */
+class InstalledVersions
+{
+    /**
+     * @var mixed[]|null
+     * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
+     */
+    private static $installed;
+
+    /**
+     * @var bool|null
+     */
+    private static $canGetVendors;
+
+    /**
+     * @var array[]
+     * @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
+     */
+    private static $installedByVendor = array();
+
+    /**
+     * Returns a list of all package names which are present, either by being installed, replaced or provided
+     *
+     * @return string[]
+     * @psalm-return list<string>
+     */
+    public static function getInstalledPackages()
+    {
+        $packages = array();
+        foreach (self::getInstalled() as $installed) {
+            $packages[] = array_keys($installed['versions']);
+        }
+
+        if (1 === \count($packages)) {
+            return $packages[0];
+        }
+
+        return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
+    }
+
+    /**
+     * Returns a list of all package names with a specific type e.g. 'library'
+     *
+     * @param  string   $type
+     * @return string[]
+     * @psalm-return list<string>
+     */
+    public static function getInstalledPackagesByType($type)
+    {
+        $packagesByType = array();
+
+        foreach (self::getInstalled() as $installed) {
+            foreach ($installed['versions'] as $name => $package) {
+                if (isset($package['type']) && $package['type'] === $type) {
+                    $packagesByType[] = $name;
+                }
+            }
+        }
+
+        return $packagesByType;
+    }
+
+    /**
+     * Checks whether the given package is installed
+     *
+     * This also returns true if the package name is provided or replaced by another package
+     *
+     * @param  string $packageName
+     * @param  bool   $includeDevRequirements
+     * @return bool
+     */
+    public static function isInstalled($packageName, $includeDevRequirements = true)
+    {
+        foreach (self::getInstalled() as $installed) {
+            if (isset($installed['versions'][$packageName])) {
+                return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * Checks whether the given package satisfies a version constraint
+     *
+     * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
+     *
+     *   Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
+     *
+     * @param  VersionParser $parser      Install composer/semver to have access to this class and functionality
+     * @param  string        $packageName
+     * @param  string|null   $constraint  A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
+     * @return bool
+     */
+    public static function satisfies(VersionParser $parser, $packageName, $constraint)
+    {
+        $constraint = $parser->parseConstraints($constraint);
+        $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
+
+        return $provided->matches($constraint);
+    }
+
+    /**
+     * Returns a version constraint representing all the range(s) which are installed for a given package
+     *
+     * It is easier to use this via isInstalled() with the $constraint argument if you need to check
+     * whether a given version of a package is installed, and not just whether it exists
+     *
+     * @param  string $packageName
+     * @return string Version constraint usable with composer/semver
+     */
+    public static function getVersionRanges($packageName)
+    {
+        foreach (self::getInstalled() as $installed) {
+            if (!isset($installed['versions'][$packageName])) {
+                continue;
+            }
+
+            $ranges = array();
+            if (isset($installed['versions'][$packageName]['pretty_version'])) {
+                $ranges[] = $installed['versions'][$packageName]['pretty_version'];
+            }
+            if (array_key_exists('aliases', $installed['versions'][$packageName])) {
+                $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
+            }
+            if (array_key_exists('replaced', $installed['versions'][$packageName])) {
+                $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
+            }
+            if (array_key_exists('provided', $installed['versions'][$packageName])) {
+                $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
+            }
+
+            return implode(' || ', $ranges);
+        }
+
+        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+    }
+
+    /**
+     * @param  string      $packageName
+     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
+     */
+    public static function getVersion($packageName)
+    {
+        foreach (self::getInstalled() as $installed) {
+            if (!isset($installed['versions'][$packageName])) {
+                continue;
+            }
+
+            if (!isset($installed['versions'][$packageName]['version'])) {
+                return null;
+            }
+
+            return $installed['versions'][$packageName]['version'];
+        }
+
+        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+    }
+
+    /**
+     * @param  string      $packageName
+     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
+     */
+    public static function getPrettyVersion($packageName)
+    {
+        foreach (self::getInstalled() as $installed) {
+            if (!isset($installed['versions'][$packageName])) {
+                continue;
+            }
+
+            if (!isset($installed['versions'][$packageName]['pretty_version'])) {
+                return null;
+            }
+
+            return $installed['versions'][$packageName]['pretty_version'];
+        }
+
+        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+    }
+
+    /**
+     * @param  string      $packageName
+     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
+     */
+    public static function getReference($packageName)
+    {
+        foreach (self::getInstalled() as $installed) {
+            if (!isset($installed['versions'][$packageName])) {
+                continue;
+            }
+
+            if (!isset($installed['versions'][$packageName]['reference'])) {
+                return null;
+            }
+
+            return $installed['versions'][$packageName]['reference'];
+        }
+
+        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+    }
+
+    /**
+     * @param  string      $packageName
+     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
+     */
+    public static function getInstallPath($packageName)
+    {
+        foreach (self::getInstalled() as $installed) {
+            if (!isset($installed['versions'][$packageName])) {
+                continue;
+            }
+
+            return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
+        }
+
+        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+    }
+
+    /**
+     * @return array
+     * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
+     */
+    public static function getRootPackage()
+    {
+        $installed = self::getInstalled();
+
+        return $installed[0]['root'];
+    }
+
+    /**
+     * Returns the raw installed.php data for custom implementations
+     *
+     * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
+     * @return array[]
+     * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
+     */
+    public static function getRawData()
+    {
+        @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
+
+        if (null === self::$installed) {
+            // only require the installed.php file if this file is loaded from its dumped location,
+            // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
+            if (substr(__DIR__, -8, 1) !== 'C') {
+                self::$installed = include __DIR__ . '/installed.php';
+            } else {
+                self::$installed = array();
+            }
+        }
+
+        return self::$installed;
+    }
+
+    /**
+     * Returns the raw data of all installed.php which are currently loaded for custom implementations
+     *
+     * @return array[]
+     * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
+     */
+    public static function getAllRawData()
+    {
+        return self::getInstalled();
+    }
+
+    /**
+     * Lets you reload the static array from another file
+     *
+     * This is only useful for complex integrations in which a project needs to use
+     * this class but then also needs to execute another project's autoloader in process,
+     * and wants to ensure both projects have access to their version of installed.php.
+     *
+     * A typical case would be PHPUnit, where it would need to make sure it reads all
+     * the data it needs from this class, then call reload() with
+     * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
+     * the project in which it runs can then also use this class safely, without
+     * interference between PHPUnit's dependencies and the project's dependencies.
+     *
+     * @param  array[] $data A vendor/composer/installed.php data set
+     * @return void
+     *
+     * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
+     */
+    public static function reload($data)
+    {
+        self::$installed = $data;
+        self::$installedByVendor = array();
+    }
+
+    /**
+     * @return array[]
+     * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
+     */
+    private static function getInstalled()
+    {
+        if (null === self::$canGetVendors) {
+            self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
+        }
+
+        $installed = array();
+
+        if (self::$canGetVendors) {
+            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
+                if (isset(self::$installedByVendor[$vendorDir])) {
+                    $installed[] = self::$installedByVendor[$vendorDir];
+                } elseif (is_file($vendorDir.'/composer/installed.php')) {
+                    $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
+                    if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
+                        self::$installed = $installed[count($installed) - 1];
+                    }
+                }
+            }
+        }
+
+        if (null === self::$installed) {
+            // only require the installed.php file if this file is loaded from its dumped location,
+            // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
+            if (substr(__DIR__, -8, 1) !== 'C') {
+                self::$installed = require __DIR__ . '/installed.php';
+            } else {
+                self::$installed = array();
+            }
+        }
+        $installed[] = self::$installed;
+
+        return $installed;
+    }
+}

+ 212 - 0
vendor/composer/installed.php

@@ -0,0 +1,212 @@
+<?php return array(
+    'root' => array(
+        'name' => 'topthink/think',
+        'pretty_version' => 'dev-master',
+        'version' => 'dev-master',
+        'reference' => 'e086746fc981203320c9105a249a14f93df5e620',
+        'type' => 'project',
+        'install_path' => __DIR__ . '/../../',
+        'aliases' => array(),
+        'dev' => true,
+    ),
+    'versions' => array(
+        'lcobucci/jwt' => array(
+            'pretty_version' => '3.4.6',
+            'version' => '3.4.6.0',
+            'reference' => '3ef8657a78278dfeae7707d51747251db4176240',
+            'type' => 'library',
+            'install_path' => __DIR__ . '/../lcobucci/jwt',
+            'aliases' => array(),
+            'dev_requirement' => false,
+        ),
+        'league/flysystem' => array(
+            'pretty_version' => '1.1.10',
+            'version' => '1.1.10.0',
+            'reference' => '3239285c825c152bcc315fe0e87d6b55f5972ed1',
+            'type' => 'library',
+            'install_path' => __DIR__ . '/../league/flysystem',
+            'aliases' => array(),
+            'dev_requirement' => false,
+        ),
+        'league/flysystem-cached-adapter' => array(
+            'pretty_version' => '1.1.0',
+            'version' => '1.1.0.0',
+            'reference' => 'd1925efb2207ac4be3ad0c40b8277175f99ffaff',
+            'type' => 'library',
+            'install_path' => __DIR__ . '/../league/flysystem-cached-adapter',
+            'aliases' => array(),
+            'dev_requirement' => false,
+        ),
+        'league/mime-type-detection' => array(
+            'pretty_version' => '1.11.0',
+            'version' => '1.11.0.0',
+            'reference' => 'ff6248ea87a9f116e78edd6002e39e5128a0d4dd',
+            'type' => 'library',
+            'install_path' => __DIR__ . '/../league/mime-type-detection',
+            'aliases' => array(),
+            'dev_requirement' => false,
+        ),
+        'psr/cache' => array(
+            'pretty_version' => '1.0.1',
+            'version' => '1.0.1.0',
+            'reference' => 'd11b50ad223250cf17b86e38383413f5a6764bf8',
+            'type' => 'library',
+            'install_path' => __DIR__ . '/../psr/cache',
+            'aliases' => array(),
+            'dev_requirement' => false,
+        ),
+        'psr/container' => array(
+            'pretty_version' => '1.1.1',
+            'version' => '1.1.1.0',
+            'reference' => '8622567409010282b7aeebe4bb841fe98b58dcaf',
+            'type' => 'library',
+            'install_path' => __DIR__ . '/../psr/container',
+            'aliases' => array(),
+            'dev_requirement' => false,
+        ),
+        'psr/http-message' => array(
+            'pretty_version' => '1.0.1',
+            'version' => '1.0.1.0',
+            'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363',
+            'type' => 'library',
+            'install_path' => __DIR__ . '/../psr/http-message',
+            'aliases' => array(),
+            'dev_requirement' => false,
+        ),
+        'psr/log' => array(
+            'pretty_version' => '1.1.4',
+            'version' => '1.1.4.0',
+            'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
+            'type' => 'library',
+            'install_path' => __DIR__ . '/../psr/log',
+            'aliases' => array(),
+            'dev_requirement' => false,
+        ),
+        'psr/simple-cache' => array(
+            'pretty_version' => '1.0.1',
+            'version' => '1.0.1.0',
+            'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b',
+            'type' => 'library',
+            'install_path' => __DIR__ . '/../psr/simple-cache',
+            'aliases' => array(),
+            'dev_requirement' => false,
+        ),
+        'symfony/polyfill-mbstring' => array(
+            'pretty_version' => 'v1.27.0',
+            'version' => '1.27.0.0',
+            'reference' => '8ad114f6b39e2c98a8b0e3bd907732c207c2b534',
+            'type' => 'library',
+            'install_path' => __DIR__ . '/../symfony/polyfill-mbstring',
+            'aliases' => array(),
+            'dev_requirement' => true,
+        ),
+        'symfony/polyfill-php72' => array(
+            'pretty_version' => 'v1.27.0',
+            'version' => '1.27.0.0',
+            'reference' => '869329b1e9894268a8a61dabb69153029b7a8c97',
+            'type' => 'library',
+            'install_path' => __DIR__ . '/../symfony/polyfill-php72',
+            'aliases' => array(),
+            'dev_requirement' => true,
+        ),
+        'symfony/polyfill-php80' => array(
+            'pretty_version' => 'v1.27.0',
+            'version' => '1.27.0.0',
+            'reference' => '7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936',
+            'type' => 'library',
+            'install_path' => __DIR__ . '/../symfony/polyfill-php80',
+            'aliases' => array(),
+            'dev_requirement' => true,
+        ),
+        'symfony/var-dumper' => array(
+            'pretty_version' => 'v4.4.47',
+            'version' => '4.4.47.0',
+            'reference' => '1069c7a3fca74578022fab6f81643248d02f8e63',
+            'type' => 'library',
+            'install_path' => __DIR__ . '/../symfony/var-dumper',
+            'aliases' => array(),
+            'dev_requirement' => true,
+        ),
+        'topthink/framework' => array(
+            'pretty_version' => 'v6.1.1',
+            'version' => '6.1.1.0',
+            'reference' => '2cb56f3e6f3c479fe90ea5f28d38d3b5ef6c4210',
+            'type' => 'library',
+            'install_path' => __DIR__ . '/../topthink/framework',
+            'aliases' => array(),
+            'dev_requirement' => false,
+        ),
+        'topthink/think' => array(
+            'pretty_version' => 'dev-master',
+            'version' => 'dev-master',
+            'reference' => 'e086746fc981203320c9105a249a14f93df5e620',
+            'type' => 'project',
+            'install_path' => __DIR__ . '/../../',
+            'aliases' => array(),
+            'dev_requirement' => false,
+        ),
+        'topthink/think-filesystem' => array(
+            'pretty_version' => 'v1.0.1',
+            'version' => '1.0.1.0',
+            'reference' => 'cfc510520db9bcd22d8d80f51d7e415a2f470af6',
+            'type' => 'library',
+            'install_path' => __DIR__ . '/../topthink/think-filesystem',
+            'aliases' => array(),
+            'dev_requirement' => false,
+        ),
+        'topthink/think-helper' => array(
+            'pretty_version' => 'v3.1.6',
+            'version' => '3.1.6.0',
+            'reference' => '769acbe50a4274327162f9c68ec2e89a38eb2aff',
+            'type' => 'library',
+            'install_path' => __DIR__ . '/../topthink/think-helper',
+            'aliases' => array(),
+            'dev_requirement' => false,
+        ),
+        'topthink/think-multi-app' => array(
+            'pretty_version' => 'v1.0.15',
+            'version' => '1.0.15.0',
+            'reference' => '387e0dac059c20f92cac5da41a871e10829c1c97',
+            'type' => 'library',
+            'install_path' => __DIR__ . '/../topthink/think-multi-app',
+            'aliases' => array(),
+            'dev_requirement' => false,
+        ),
+        'topthink/think-orm' => array(
+            'pretty_version' => 'v2.0.54',
+            'version' => '2.0.54.0',
+            'reference' => '97b061b47616301ff29fbd4c35ed9184e1162e4e',
+            'type' => 'library',
+            'install_path' => __DIR__ . '/../topthink/think-orm',
+            'aliases' => array(),
+            'dev_requirement' => false,
+        ),
+        'topthink/think-template' => array(
+            'pretty_version' => 'v2.0.8',
+            'version' => '2.0.8.0',
+            'reference' => 'abfc293f74f9ef5127b5c416310a01fe42e59368',
+            'type' => 'library',
+            'install_path' => __DIR__ . '/../topthink/think-template',
+            'aliases' => array(),
+            'dev_requirement' => false,
+        ),
+        'topthink/think-trace' => array(
+            'pretty_version' => 'v1.5',
+            'version' => '1.5.0.0',
+            'reference' => '55027fd79abb744f32a3be8d9e1ccf873a3ca9b7',
+            'type' => 'library',
+            'install_path' => __DIR__ . '/../topthink/think-trace',
+            'aliases' => array(),
+            'dev_requirement' => true,
+        ),
+        'topthink/think-view' => array(
+            'pretty_version' => 'v1.0.14',
+            'version' => '1.0.14.0',
+            'reference' => 'edce0ae2c9551ab65f9e94a222604b0dead3576d',
+            'type' => 'library',
+            'install_path' => __DIR__ . '/../topthink/think-view',
+            'aliases' => array(),
+            'dev_requirement' => false,
+        ),
+    ),
+);

+ 26 - 0
vendor/composer/platform_check.php

@@ -0,0 +1,26 @@
+<?php
+
+// platform_check.php @generated by Composer
+
+$issues = array();
+
+if (!(PHP_VERSION_ID >= 70205)) {
+    $issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.5". You are running ' . PHP_VERSION . '.';
+}
+
+if ($issues) {
+    if (!headers_sent()) {
+        header('HTTP/1.1 500 Internal Server Error');
+    }
+    if (!ini_get('display_errors')) {
+        if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
+            fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
+        } elseif (!headers_sent()) {
+            echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
+        }
+    }
+    trigger_error(
+        'Composer detected issues in your platform: ' . implode(' ', $issues),
+        E_USER_ERROR
+    );
+}