Browse Source

0710-0248-h01

Zory 3 tuần trước cách đây
mục cha
commit
8f460f5526

+ 98 - 0
app/controller/v2/Address.php

@@ -0,0 +1,98 @@
+<?php
+
+namespace app\controller\v2;
+
+use app\extra\basic\Base;
+use app\extra\service\blue\AddressService;
+use app\middleware\WxMiddleware;
+use app\model\blue\BlueAddress;
+use DI\Attribute\Inject;
+use LinFly\Annotation\Route\Controller;
+use LinFly\Annotation\Route\Middleware;
+use LinFly\Annotation\Route\Route;
+use support\Request;
+use support\Response;
+
+
+#[Controller(prefix: "/wx_v2/address"),Middleware(WxMiddleware::class)]
+class Address extends Base
+{
+
+
+    protected array $noNeedLogin = [];
+
+    #[Inject]
+    protected BlueAddress $model;
+
+    #[Inject]
+    protected AddressService $service;
+
+
+    /**
+     * 地址列表
+     * @param Request $request
+     * @return Response
+     */
+    #[Route(path: "list",methods: "get")]
+    public function getAddressList(Request $request): Response
+    {
+        try {
+            $param = $this->_valid([
+                "size.default"      => 10,
+                "page.default"      => 1,
+            ],$request->method());
+            $list = $this->service->getList(['openid' => $request->user['openid'],'pageSize' => $param['size'],'page' => $param['page']]);
+            return success("ok",pageFormat($list));
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+    /**
+     * 编辑信息
+     * @param Request $request
+     * @return Response
+     */
+    #[Route(path: "save",methods: "post")]
+    public function setListData(Request $request): Response
+    {
+        try {
+            $param = $request->post();
+            if (isset($param['id'])) {
+                $factory = $this->model->where("id",$param['id'])->findOrEmpty();
+                if ($factory->isEmpty()) return errorTrans("error.data");
+            }
+            $param['city_path'] = empty($param['city_path']) ? [] : json_encode($param['city_path']);
+            $param['openid'] = $request->user['openid'];
+            $state = $this->model->setAutoData($param);
+            if (!$state) return errorTrans("error.data");
+            return successTrans("success.data");
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+    /**
+     * 删除
+     * @param Request $request
+     * @return Response
+     */
+    #[Route(path: "del",methods: "post")]
+    public function delData(Request $request): Response
+    {
+        try {
+            $param = $this->_valid([
+                "id.require"        => "参数错误",
+            ],"post");
+            if (!is_array($param)) return error($param);
+            $data = $this->model->where(['id' => $param['id'], 'openid' => $request->user['openid'] ])->findOrEmpty();
+            if ($data->isEmpty()) return errorTrans("empty.data");
+            $state = $data->delete();
+            if (!$state) return errorTrans("error.data");
+            return successTrans("success.data");
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+}

+ 120 - 0
app/controller/v2/Auth.php

@@ -0,0 +1,120 @@
+<?php
+
+namespace app\controller\v2;
+
+use app\extra\basic\Base;
+use app\middleware\WxMiddleware;
+use app\model\blue\BlueExpert;
+use app\model\blue\BlueExpertGroup;
+use app\validate\blue\ExpertGroupValidate;
+use app\validate\blue\ExpertValidate;
+use DI\Attribute\Inject;
+use LinFly\Annotation\Route\Controller;
+use LinFly\Annotation\Route\Middleware;
+use LinFly\Annotation\Route\Route;
+use support\Request;
+use support\Response;
+
+
+#[Controller(prefix: "/wx_v2/auth"),Middleware(WxMiddleware::class)]
+class Auth extends Base
+{
+
+    #[Inject]
+    protected ExpertValidate $validate;
+
+    #[Inject]
+    protected ExpertGroupValidate $groupValidate;
+
+    #[Inject]
+    protected BlueExpert $model;
+
+    #[Inject]
+    protected BlueExpertGroup $modelGroup;
+
+    /**
+     * @param Request $request
+     * @return Response
+     */
+    #[Route(path: "star",methods: "post")]
+    public function setUserCert(Request $request): Response
+    {
+        try {
+            $param = $request->post();
+            $param['openid'] = $request->user['openid'];
+            $data = $this->model->where("openid",$param['openid'])->findOrEmpty();
+            if (!$data->isEmpty()) {
+                if ($data['status'] <> 1) return error("请勿重复提交");
+            };
+            if (!$this->validate->scene('add')->check($param)) return error($this->validate->getError());
+            $state = $data->setAutoData($param);
+            if (!$state) return errorTrans("error.data");
+            return successTrans("success.data");
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+
+    /**
+     * 入驻检测
+     * @param Request $request
+     * @return Response
+     */
+    #[Route(path: "star/check",methods: "get")]
+    public function checkUserCert(Request $request): Response
+    {
+        try {
+            $data = $this->model->where("openid",$request->user['openid'])->findOrEmpty();
+            if ($data->isEmpty()) return success("ok",['status' => 0]);
+            if ($data['status'] == 2) return success("ok",['status' => 2,"remark" => $data['remark']]);
+            return success("ok",['status' => 1]);
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+
+    /**
+     * @param Request $request
+     * @return Response
+     */
+    #[Route(path: "group",methods: "post")]
+    public function setGroupCert(Request $request): Response
+    {
+        try {
+            $param = $request->all();
+            $param['openid'] = $request->user['openid'];
+            $data = $this->modelGroup->where("openid",$param['openid'])->findOrEmpty();
+            if (!$data->isEmpty()) {
+                if ($data['status'] <> 1) return error("请勿重复提交");
+            };
+            if (!$this->groupValidate->scene('add')->check($param)) return error($this->groupValidate->getError());
+            $state = $data->setAutoData($param);
+            if (!$state) return errorTrans("error.data");
+            return successTrans("success.data");
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+
+    /**
+     * 入驻检测
+     * @param Request $request
+     * @return Response
+     */
+    #[Route(path: "group/check",methods: "get")]
+    public function checkGroupCert(Request $request): Response
+    {
+        try {
+            $data = $this->modelGroup->where("openid",$request->user['openid'])->findOrEmpty();
+            if ($data->isEmpty()) return success("ok",['status' => 0]);
+            if ($data['status'] == 2) return success("ok",['status' => 2,"remark" => $data['remark']]);
+            return success("ok",['status' => 1]);
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+}

+ 122 - 0
app/controller/v2/Page.php

@@ -0,0 +1,122 @@
+<?php
+
+namespace app\controller\v2;
+
+use app\extra\basic\Base;
+use app\extra\tools\DouyinUserInfo;
+use app\model\system\SystemData;
+use LinFly\Annotation\Route\Controller;
+use LinFly\Annotation\Route\Route;
+use support\Request;
+use support\Response;
+
+
+#[Controller(prefix: "/wx_v2/page")]
+class Page extends Base
+{
+
+
+    #[Route(path: "about",methods: "get")]
+    public function getAbout(Request $request)
+    {
+        try {
+            $data = sConf("page.about");
+            return json_encode(['code' => 1,'data' => $data],JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+    #[Route(path: "rule",methods: "get")]
+    public function getRule(Request $request)
+    {
+        try {
+            $data = sConf("page.rule");
+            return json_encode(['code' => 1,'data' => $data]);
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+
+    #[Route(path: "privacy",methods: "get")]
+    public function getPrivacy(Request $request)
+    {
+        try {
+            $data = sConf("page.privacy");
+//            return json_encode(['code' => 1,'data' => $data]);
+            return successTrans("success.data",compact("data"));
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+
+    #[Route(path: "agreements",methods: "get")]
+    public function getAgreements(Request $request)
+    {
+        try {
+            $data = sConf("page.agreements");
+            return json_encode(['code' => 1,'data' => $data]);
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+    /**
+     * 三级城市信息
+     * @param Request $request
+     * @return Response
+     */
+    #[Route(path: "city",methods: "get")]
+    public function getCityData(Request $request): Response
+    {
+        try {
+            $data = json_decode(file_get_contents(base_path()."/city.json"),true);
+            return successTrans("success.data",$data);
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+    /**
+     * 数据字典
+     * @param Request $request
+     * @return Response
+     */
+    #[Route(path: "dic",methods: "get")]
+    public function getDicData(Request $request): Response
+    {
+        try {
+            $param = $this->_valid([
+                "type.require"  => trans("empty.require")
+            ],$request->all());
+            if (!is_array($param)) return error($param);
+            $data = (new SystemData)->where("code",$param['type'])->value("content");
+            $data = !empty($data) ? json_decode($data,true) : [];
+            return successTrans("success.data",$data);
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+
+    /**
+     * 数据字典
+     * @param Request $request
+     * @return Response
+     */
+    #[Route(path: "dy",methods: "get")]
+    public function getDyUserData(Request $request): Response
+    {
+        try {
+            $url = "https://v.douyin.com/pVGt_Mbl_0Y/";
+            $data = (new DouyinUserInfo)->getInfo($url);
+            print_r($data);
+            return successTrans("success.data",$data);
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+}

+ 90 - 0
app/controller/v2/Platform.php

@@ -0,0 +1,90 @@
+<?php
+
+namespace app\controller\v2;
+
+use app\extra\basic\Base;
+use app\extra\tools\DouyinUserInfo;
+use app\middleware\WxMiddleware;
+use app\model\blue\BlueCategory;
+use app\model\blue\BlueExpertPlatform;
+use LinFly\Annotation\Route\Controller;
+use LinFly\Annotation\Route\Middleware;
+use LinFly\Annotation\Route\Route;
+use support\Request;
+use support\Response;
+
+
+#[Controller(prefix: "/wx_v2/platform"),Middleware(WxMiddleware::class)]
+class Platform extends Base
+{
+
+
+    /**
+     * 用户绑定平台列表
+     * @param Request $request
+     * @return Response
+     */
+    #[Route(path: "list",methods: "get")]
+    public function getPlatformList(Request $request): Response
+    {
+        try {
+            $platform = (new BlueCategory)->where(["type" =>1,"status" => 1])->with(['platform' => function($query) use($request){
+                $query->where("openid",$request->user['openid'])->field("source,nickname,avatar,follower_count,unique_id");
+            }])->field("name,icon,sign")->select();
+            if ($platform->isEmpty()) return errorTrans("error.data");
+            return successTrans("success.data",$platform->toArray());
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+    #[Route(path: "bind",methods: "post")]
+    public function bindPlatform(Request $request): Response
+    {
+        try {
+            $param = $this->_valid([
+                "url.require"       => trans("empty.require"),
+                "platform.require"  => trans("empty.require"),
+            ],$request->method());
+            if (!is_array($param)) return error($param);
+            $url = get_first_url($param['url']);
+            if (empty($url)) return error("主页链接格式错误");
+            $platform = (new BlueExpertPlatform)->where(["openid" => $request->user['openid'],'source' => $param['platform']])->findOrEmpty();
+            if (!$platform->isEmpty()) return error("请勿重复绑定");
+            switch ($param['platform'])
+            {
+                case "kuaishou":
+                    $userData = [];
+                    break;
+                case "douyin":
+                default:
+                    [$state,$platformData] = (new DouyinUserInfo)->getDyInfo($url);
+                    if (!$state) return error($platformData);
+                    $userData = [
+                        "openid"            => $request->user['openid'],
+                        "source"            => $param['platform'],
+                        "nickname"          => $platformData['nickname'],
+                        "avatar"            => $platformData['avatar_larger']['url_list'][0]??'',
+                        "aweme_count"       => $platformData['aweme_count'],
+                        "follower_count"    => $platformData['follower_count'],
+                        "sec_uid"           => $platformData['sec_uid'],
+                        "signature"         => $platformData['signature'],
+                        "unique_id"         => $platformData['unique_id'],
+                        "uid"               => $platformData['uid'],
+                        "total_favorited"   => $platformData['total_favorited'],
+                        "url"               => $url,
+//                        "star_id"           => $platformData['']
+                    ];
+                    break;
+            }
+            $state = $platform->insertGetId($userData);
+            if (!$state) return errorTrans("error.data");
+            return successTrans("success.data");
+        } catch (\Throwable $throwable) {
+            echo $throwable->getLine()."\n";
+            echo $throwable->getFile()."\n";
+            return error($throwable->getMessage());
+        }
+    }
+
+}

+ 2 - 1
app/controller/v2/Portal.php

@@ -7,6 +7,7 @@ use app\extra\service\blue\TaskService;
 use app\middleware\WxMiddleware;
 use app\model\blue\BlueBanner;
 use app\model\blue\BlueCategory;
+use app\model\blue\BlueExpertPlatform;
 use DI\Attribute\Inject;
 use LinFly\Annotation\Route\Controller;
 use LinFly\Annotation\Route\Middleware;
@@ -51,7 +52,7 @@ class Portal extends Base
                 "title" => sConf("wechat.share_title")
             ];
             $rank = [];
-            $star = [];
+            $star = (new BlueExpertPlatform)->order("create_at","desc")->field("source,nickname,avatar,follower_count,create_at")->limit(10)->select()->toArray();
             $list = $this->service->getHomeList(['category' => $param['category'],'pageSize' => $param['size'],'page' => $param['page']]);
             $task = pageFormat($list);
             return success("ok",compact("banner","category",'task','share','rank','star'));

+ 96 - 0
app/controller/v2/School.php

@@ -0,0 +1,96 @@
+<?php
+
+namespace app\controller\v2;
+
+use app\extra\basic\Base;
+use app\extra\service\blue\ArticleService;
+use app\extra\service\blue\CategoryService;
+use app\middleware\WxMiddleware;
+use app\model\blue\BlueArticle;
+use app\model\blue\BlueCategory;
+use DI\Attribute\Inject;
+use LinFly\Annotation\Route\Controller;
+use LinFly\Annotation\Route\Middleware;
+use LinFly\Annotation\Route\Route;
+use support\Request;
+use support\Response;
+use think\facade\Db;
+
+
+#[Controller(prefix: "/wx_v2/school"),Middleware(WxMiddleware::class)]
+class School extends Base
+{
+
+    protected array $noNeedLogin = ['getPortalData','getArticleDetail','getCategoryData'];
+
+    #[Inject]
+    protected CategoryService $service;
+
+    #[Inject]
+    protected BlueArticle $article;
+
+    #[Inject]
+    protected BlueCategory $category;
+
+    #[Inject]
+    protected ArticleService $articleService;
+
+    /**
+     * 商学院首页
+     * @param Request $request
+     * @return Response
+     */
+    #[Route(path: "portal",methods: "get")]
+    public function getPortalData(Request $request): Response
+    {
+        try {
+            $data = $this->service->getPortalData($request->all());
+            return successTrans("success.data",$data);
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+
+    #[Route(path: "category",methods: "get")]
+    public function getCategoryData(Request $request): Response
+    {
+        try {
+            $param = $this->_valid([
+                "id.require"    => trans("empty.require"),
+                "page.default"  => 1,
+                "size.default"  => 10
+            ],$request->method());
+            if (!is_array($param)) return error($param);
+            $category = $this->category->where("id",$param['id'])->findOrEmpty();
+            if ($category->isEmpty()) return errorTrans("empty.data");
+            $list = $this->articleService->getSchoolList(["category" => $param['id'],'pageSize' => $param['size'],'page' => $param['page']]);
+            return successTrans("success.data",pageFormat($list));
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+    /**
+     * 文章详情
+     * @param Request $request
+     * @return Response
+     */
+    #[Route(path: "detail",methods: "get")]
+    public function getArticleDetail(Request $request): Response
+    {
+        try {
+            $param = $this->_valid([
+                "id.require"    => trans("empty.require")
+            ],$request->method());
+            if (!is_array($param)) return error($param);
+            $data = $this->article->where("id",$param['id'])->findOrEmpty();
+            if ($data->isEmpty()) return errorTrans("empty.data");
+            $data->inc("view")->save();
+            return successTrans("success.data",$data->toArray());
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+}

+ 74 - 0
app/controller/v2/User.php

@@ -7,6 +7,9 @@ use app\extra\tools\CodeExtend;
 use app\extra\weMini\Crypt;
 use app\extra\weMini\UserInfo;
 use app\middleware\WxMiddleware;
+use app\model\blue\BlueExpert;
+use app\model\blue\BlueExpertPlatform;
+use app\model\blue\BlueTaskRevenue;
 use app\model\blue\BlueUserOpen;
 use DI\Attribute\Inject;
 use LinFly\Annotation\Route\Controller;
@@ -28,6 +31,11 @@ class User extends Base
     protected BlueUserOpen $model;
 
 
+    /**
+     * wx.login快速验证是否注册
+     * @param Request $request
+     * @return Response
+     */
     #[Route(path: "quick",methods: "post")]
     public function loginQuick(Request $request): Response
     {
@@ -52,6 +60,11 @@ class User extends Base
         }
     }
 
+    /**
+     * 新用户登录-自动完成注册
+     * @param Request $request
+     * @return Response
+     */
     #[Route(path: "login",methods: "post")]
     public function loginMobile(Request $request): Response
     {
@@ -93,4 +106,65 @@ class User extends Base
         }
     }
 
+    #[Route(path: "data",methods: "get")]
+    public function getUserData(Request $request): Response
+    {
+        try {
+            $data = $this->model->where("openid",$request->user['openid'])->field("uuid,nickname,headimg,openid")->with(['star' => function($query) {
+                $query->field("openid,group_id,level_exp")->with(['level' => function($query) {
+                    $query->field("id,level,name,exp");
+                }]);
+            }])->append(['fans','job','income','level','sign'])->withAttr([
+                "fans"  => function($query,$resp) {
+                    $fans = (new BlueExpertPlatform)->where("openid",$resp['openid'])->sum("follower_count");
+                    return formatMoneyKw($fans); // 全网粉丝数
+                },
+                "job"  => function($query,$resp) {
+                    return "0"; // 任务数
+                },
+                "income" => function($query,$resp) {
+                    $income = (new BlueTaskRevenue)->where("openid",$resp['openid'])->sum("indicator_agg_data_20022");
+                    return formatMoneyKw($income/1000); // 收益
+                },
+                "sign"  => function($query,$resp) {
+                    if ($resp['star']) return 1;
+                    return 0;
+                },
+                "level" => function($query,$resp) {
+                    if ($resp['star']) {
+                        return [
+                            "level_exp" => $resp['star']['level_exp'],
+                            "level_num" => $resp['star']['level']['level']??'0',
+                            "level_name" => $resp['star']['level']['name']??'0',
+                            "need_exp"  => $resp['star']['level']['exp']??'0',
+                        ];
+                    } else {
+                        return [];
+                    }
+                }
+            ])->findOrEmpty();
+            if ($data->isEmpty()) return errorTrans("error.data");
+            $return = $data->toArray();
+            unset($return['star'],$return['openid']);
+            return success("ok",$return);
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+    /**
+     * 收益
+     * @param Request $request
+     * @return Response
+     */
+    #[Route(path: "income",methods: "get")]
+    public function getIncomeData(Request $request): Response
+    {
+        try {
+
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
 }

+ 21 - 8
app/extra/tools/DouyinUserInfo.php

@@ -7,15 +7,28 @@ use yzh52521\EasyHttp\Http;
 class DouyinUserInfo
 {
 
-    public function getInfo(string $url = ""): array
+    public function curlPost($url, $data)
     {
-        $user = Http::asJson()->post("https://douyin.wtf/api/douyin/web/get_all_sec_user_id",[$url])->array();
-        if ($user['code'] <> 200) return [0,'用户信息获取失败'];
-        $userData = Http::asJson()->get("https://douyin.wtf/api/douyin/web/handler_user_profile",[
-            "sec_user_id" => $user['data'][0]
-        ])->array();
-        if ($userData['code'] <> 200) return [0,'用户信息获取失败'];
-        return [1,$userData['data']];
+        return Http::asJson()->withHeaders([
+            "Authorization" => "Bearer jJgmOt0B7nmPxWOrR4io+BiJDRmuAZpGyQnao1XbTtuX1l2xP12RWgyiEQ=="
+        ])->post("https://api.tikhub.dev".$url, $data)->array();
+    }
+
+    public function curlGet($url, $data)
+    {
+        return Http::asJson()->withHeaders([
+            "Authorization" => "Bearer jJgmOt0B7nmPxWOrR4io+BiJDRmuAZpGyQnao1XbTtuX1l2xP12RWgyiEQ=="
+        ])->get("https://api.tikhub.dev".$url, $data)->array();
+    }
+
+    public function getDyInfo(string $url = ""): array
+    {
+        $scIdData = $this->curlGet("/api/v1/douyin/web/get_sec_user_id",['url'=>$url]);
+        if ($scIdData['code'] <> 200) return [0,$scIdData['message_zh']];
+        $scId = $scIdData['data'];
+        $userData = $this->curlGet("/api/v1/douyin/web/handler_user_profile",['sec_user_id' => $scId]);
+        if ($userData['code'] <> 200) return [0,$userData['message_zh']];
+        return [1,$userData['data']['user']];
     }
 
 }

+ 16 - 0
app/functions.php

@@ -730,4 +730,20 @@ if(! function_exists('removeEmoji2'))
         $str = preg_replace('/\s+/', ' ', $str);
         return trim($str);
     }
+}
+if (! function_exists('get_first_url'))
+{
+    /**
+     * 提取第一条完整链接,自动剔除末尾粘连标点
+     */
+    function get_first_url(string $text): string
+    {
+        // 第一步:匹配 http/https 开头直到空格换行为止
+        if (!preg_match('/https?:\/\/\S+/', $text, $match)) {
+            return '';
+        }
+        $url = $match[0];
+        // 第二步:删除链接最后多余的中英文标点
+        return rtrim($url, ',。;!?,.、;:<>"\'()】】');
+    }
 }

+ 6 - 0
app/model/blue/BlueCategory.php

@@ -4,6 +4,7 @@ namespace app\model\blue;
 
 use app\extra\basic\Model;
 use think\model\relation\HasMany;
+use think\model\relation\HasOne;
 
 
 /**
@@ -50,4 +51,9 @@ class BlueCategory extends Model
         return $this->hasMany(BlueArticle::class,"category","id");
     }
 
+    public function platform(): HasOne
+    {
+        return $this->hasOne(BlueExpertPlatform::class,"source","sign");
+    }
+
 }

+ 5 - 0
app/model/blue/BlueExpert.php

@@ -60,4 +60,9 @@ class BlueExpert extends Model
         return $this->hasMany(BlueExpertPlatform::class,"openid","openid");
     }
 
+    public function level(): HasOne
+    {
+        return $this->hasOne(BlueExpertLevel::class,"id","group_id");
+    }
+
 }

+ 45 - 0
app/model/blue/BlueTaskCollection.php

@@ -0,0 +1,45 @@
+<?php
+
+namespace app\model\blue;
+
+use app\extra\basic\Model;
+
+
+/**
+ * @property integer $id (主键)
+ * @property mixed $openid 
+ * @property mixed $job_id 
+ * @property mixed $create_at 创建时间
+ */
+class BlueTaskCollection extends Model
+{
+    /**
+     * The connection name for the model.
+     *
+     * @var string|null
+     */
+    protected $connection = 'mysql';
+    
+    /**
+     * The table associated with the model.
+     *
+     * @var string
+     */
+    protected string $table = "blue_task_collection";
+    
+    /**
+     * The primary key associated with the table.
+     *
+     * @var string
+     */
+    protected string $primaryKey = "id";
+    
+    /**
+     * Indicates if the model should be timestamped.
+     *
+     * @var bool
+     */
+    public bool $timestamps = false;
+
+
+}

+ 49 - 0
app/model/blue/BlueUserBank.php

@@ -0,0 +1,49 @@
+<?php
+
+namespace app\model\blue;
+
+use app\extra\basic\Model;
+
+
+/**
+ * @property integer $id (主键)
+ * @property mixed $openid 
+ * @property string $truename 
+ * @property string $idcard 
+ * @property mixed $bank_num 
+ * @property string $bank_name 
+ * @property mixed $mobile 
+ * @property mixed $create_at 创建时间
+ */
+class BlueUserBank extends Model
+{
+    /**
+     * The connection name for the model.
+     *
+     * @var string|null
+     */
+    protected $connection = 'mysql';
+    
+    /**
+     * The table associated with the model.
+     *
+     * @var string
+     */
+    protected string $table = "blue_user_bank";
+    
+    /**
+     * The primary key associated with the table.
+     *
+     * @var string
+     */
+    protected string $primaryKey = "id";
+    
+    /**
+     * Indicates if the model should be timestamped.
+     *
+     * @var bool
+     */
+    public bool $timestamps = false;
+
+
+}

+ 9 - 3
app/model/blue/BlueUserOpen.php

@@ -3,12 +3,13 @@
 namespace app\model\blue;
 
 use app\extra\basic\Model;
+use think\model\relation\HasOne;
 
 
 /**
- * @property integer $id (主键)
- * @property mixed $openid 
- * @property string $nickname 
+ * @property integer $id (主键)
+ * @property mixed $openid 
+ * @property string $nickname 
  * @property mixed $create_at 创建时间
  */
 class BlueUserOpen extends Model
@@ -42,4 +43,9 @@ class BlueUserOpen extends Model
     public bool $timestamps = false;
 
 
+    public function star(): HasOne
+    {
+        return $this->hasOne(BlueExpert::class,"openid","openid");
+    }
+
 }

+ 48 - 0
app/model/blue/BlueWithdrawLog.php

@@ -0,0 +1,48 @@
+<?php
+
+namespace app\model\blue;
+
+use app\extra\basic\Model;
+
+
+/**
+ * @property integer $id (主键)
+ * @property mixed $openid 
+ * @property integer $bank_id 
+ * @property integer $money 
+ * @property integer $status 0审核1到账2失败
+ * @property string $remark 
+ * @property mixed $create_at 创建时间
+ */
+class BlueWithdrawLog extends Model
+{
+    /**
+     * The connection name for the model.
+     *
+     * @var string|null
+     */
+    protected $connection = 'mysql';
+    
+    /**
+     * The table associated with the model.
+     *
+     * @var string
+     */
+    protected string $table = "blue_withdraw_log";
+    
+    /**
+     * The primary key associated with the table.
+     *
+     * @var string
+     */
+    protected string $primaryKey = "id";
+    
+    /**
+     * Indicates if the model should be timestamped.
+     *
+     * @var bool
+     */
+    public bool $timestamps = false;
+
+
+}

+ 2 - 0
resource/translations/zh_CN/messages.php

@@ -17,6 +17,8 @@ return [
         "status-qrcode" => "请先开启后再生成二维码",
         "captcha"       => "验证码输入错误",
         "mobile"        => "手机号码格式错误",
+        "idcard"        => "身份证号码格式错误",
+        "email"         => "邮箱格式错误",
         "sms-repeat"    => "请勿重复获取",
         "sms"           => "获取验证码失败,请联系管理员",
         "mobile-empty"  => "手机号未注册,请开通后再重试",