zory 2 ماه پیش
والد
کامیت
309e37dd02

+ 1 - 1
app/controller/admin/Expert.php

@@ -42,6 +42,6 @@ class Expert extends Base
             return error($throwable->getMessage());
         }
     }
-    
+
 
 }

+ 0 - 1
app/controller/admin/Pages.php

@@ -58,7 +58,6 @@ class Pages extends Base
             if (!isset($param['id'])) {
                 if (!$data->isEmpty()) return errorTrans("empty.data");
             }
-            print_r($param);
             $state = $this->model->setAutoData($param);
             if (!$state) return errorTrans("error.data");
             return successTrans("success.data");

+ 56 - 0
app/controller/admin/Task.php

@@ -0,0 +1,56 @@
+<?php
+
+namespace app\controller\admin;
+
+use app\extra\basic\Base;
+use app\extra\tools\XcJob;
+use app\middleware\AuthMiddleware;
+use LinFly\Annotation\Route\Controller;
+use LinFly\Annotation\Route\Middleware;
+use LinFly\Annotation\Route\Route;
+use support\Request;
+use support\Response;
+
+
+#[Controller(prefix: "/api/task"),Middleware(AuthMiddleware::class)]
+class Task extends Base
+{
+
+
+    /**
+     * 获取星川任务详情
+     * @param Request $request
+     * @return Response
+     */
+    #[Route(path: "job",methods: "get")]
+    public function getJobDetail(Request $request): Response
+    {
+        try {
+            $param = $this->_valid([
+                "job_id.require"    => trans("empty.require")
+            ]);
+            if (!is_array($param)) return error($param);
+            $data = (new XcJob)->token()->getJobDetail($param['job_id']);
+            if ($data['base_resp']['status_code'] <> 0) return error("获取任务失败");
+            $task  = [
+                "expiration_time_end"   => date("Y-m-d H:i:s",$data['object_field_info']['object_basic_info']['expiration_time_end']),
+                "title"                 => $data['object_field_info']['object_basic_info']['object_name']??'',
+                "product_cover_url"     => $data['object_field_info']['object_product_info']['product_cover_url']??'',
+                "product_name"          => $data['object_field_info']['object_product_info']['product_name']??'',
+                "product_id"            => $data['object_field_info']['object_product_info']['external_product_id']??'',
+                "auto"                  => 2,
+                "job_id"                => $param['job_id'],
+                "category"              => "douyin",
+                "category_detail"       => $data['object_field_info']['object_product_info']['category_detail']['second_cname']??'',
+                "product_selling_point" => $data['object_field_info']['object_product_info']['product_selling_point_detail']??'',
+                "target_audience"       => $data['object_field_info']['object_product_info']['target_audience_desc']??'',
+                "content"               => $data['object_field_info']['object_requirement_info']['author_preference']?nl2br($data['object_field_info']['object_requirement_info']['author_preference']):'',
+                "total_budget"          => $data['object_field_info']['object_project_info']['total_budget_fen']?format_money_bit($data['object_field_info']['object_project_info']['total_budget_fen']/100):'',
+            ];
+            return success("ok",$task);
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+}

+ 120 - 0
app/controller/api/Certification.php

@@ -0,0 +1,120 @@
+<?php
+
+namespace app\controller\api;
+
+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_api/certification"),Middleware(WxMiddleware::class)]
+class Certification 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: "user",methods: "post")]
+    public function setUserCert(Request $request): Response
+    {
+        try {
+            $param = $request->all();
+            $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: "user/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());
+        }
+    }
+
+}

+ 0 - 193
app/controller/api/Home.php

@@ -1,193 +0,0 @@
-<?php
-
-namespace app\controller\api;
-
-use app\extra\basic\Base;
-use app\extra\tools\CodeExtend;
-use app\extra\weMini\Crypt;
-use app\middleware\WxMiddleware;
-use app\model\saas\SaasShop;
-use app\model\saas\SaasUser;
-use app\model\saas\SaasUserOpen;
-use LinFly\Annotation\Route\Controller;
-use LinFly\Annotation\Route\Route;
-use support\Request;
-use support\Response;
-use LinFly\Annotation\Route\Middleware;
-use Shopwwi\WebmanAuth\Facade\Auth as AuthMode;
-use support\think\Db;
-
-
-#[Controller(prefix: "/wx_api/default"),Middleware(WxMiddleware::class)]
-class Home extends Base
-{
-
-
-    protected array $whiteShop = [
-        "10888572278827"    => "10888572278827", // 惠印多马村店
-        "10888566286841"    => "327545130062964", // 中站小学店
-        "10888590458813"    => "326945519114632", // 幸小印美店
-        "10888645729727"    => "326844775971796", // 焦作和平街店
-    ];
-
-    /**
-     * 跳出授权
-     * @var array|string[]
-     */
-    protected array $noNeedLogin = ['loginHome','changeData','changeDataSubmit'];
-
-
-    #[Route(path: "change_save",methods: "post")]
-    public function changeDataSubmit(Request $request): Response
-    {
-        try {
-            $param = $this->_valid([
-                "shop.require"  => "",
-                "old.require"  => "",
-                "openid.default"  => ""
-            ],$request->method());
-            if (!is_array($param)) return error($param);
-            $member = (new SaasUser)->where("openid",$param['openid'])->findOrEmpty();
-            if (!$member->isEmpty()) return error("无需多次操作");
-            $old = Db::connect("old")->table("inmei_member_card")->where("openid",$param['old'])->findOrEmpty();
-            if (isset($this->whiteShop[$param['shop']])) {
-                $shopId = $this->whiteShop[$param['shop']];
-            } else {
-                $shopId = $param['shop'];
-            }
-            $state = $member->insertGetId([
-                "openid"    => $param['openid'],
-                "shop_id"   => $shopId,
-                "card_no"   => strtoupper(md5($param['openid'].$shopId)),
-                "balance"   => $old['balance'],
-                "total_balance" => $old['total_balance']
-            ]);
-            if (!$state) return error("操作失败");
-            return success("转入成功");
-        } catch (\Throwable $throwable) {
-            return error($throwable->getMessage());
-        }
-    }
-
-    #[Route(path: "change",methods: "post")]
-    public function changeData(Request $request): Response
-    {
-        try {
-            $param = $this->_valid([
-                "shop.require"  => "",
-                "code.require"  => "",
-                "openid.default"  => ""
-            ],$request->method());
-            if (!is_array($param)) return error($param);
-            $userinfo = (new Crypt([
-                "appid"     => sConf("wechat.mini_appid"),
-                "appsecret" => sConf("wechat.mini_secret")
-            ]))->session($param['code']);
-            if (!isset($userinfo['openid'])) return error("获取数据失败");
-            $openId = $userinfo['openid'];
-            $old = Db::connect("old")->table("inmei_member_card")->where("openid",$param['openid'])->where("shop_id",$param['shop'])->findOrEmpty();
-            if (empty($old)) $old = null;
-            if (isset($this->whiteShop[$param['shop']])) {
-                $shopId = $this->whiteShop[$param['shop']];
-            } else {
-                $shopId = $param['shop'];
-            }
-            $shop = (new SaasShop)->where("shop_id",$shopId)->findOrEmpty();
-            if ($shop->isEmpty()) $shop = null;
-            return success("ok",compact("shop",'old','openId'));
-        } catch (\Throwable $throwable) {
-            return error($throwable->getMessage());
-        }
-    }
-
-
-    /**
-     * 首页信息
-     * @return Response
-     */
-    #[Route(path: "home",methods: "post")]
-    public function loginHome(Request $request)
-    {
-        try {
-            $param = $this->_valid([
-                "shop.require"  => "",
-                "print.require" => "",
-                "code.require"  => "",
-                "card.default"  => "",
-                "oshop.default"  => "",
-                "oid.default"  => ""
-            ],$request->method());
-            if (!is_array($param)) return error($param);
-            $userinfo = (new Crypt([
-                "appid"     => sConf("wechat.mini_appid"),
-                "appsecret" => sConf("wechat.mini_secret")
-            ]))->session($param['code']);
-            if (!isset($userinfo['openid'])) return error("获取数据失败");
-            $map = ['is_deleted' => 0, 'openid' => $userinfo['openid']];
-            $user = (new SaasUserOpen)->where($map)->findOrEmpty();
-            if ($user->isEmpty()) {
-                $user->insertGetId(['openid' => $userinfo['openid'],'oid' => ($param['oid'] == 'undefined'?'':$param['oid']),'update_at' => getDateFull(),"create_ip" => $request->getRealIp(),"nickname" => "微信用户","headimg" => "https://inmei-print.oss-cn-guangzhou.aliyuncs.com/logo.png"]);
-                $user = (new SaasUserOpen)->where($map)->findOrEmpty();
-            } else {
-                if (!empty($param['oid']) && empty($user['oid'])) {
-                    if ($param['oid'] !== 'undefined') {
-                        $user->oid = ($param['oid'] == 'undefined'?'':$param['oid']);
-                        $user->update_at = getDateFull();
-                        $user->save();
-                    }
-                }
-            }
-            $userAuth = get_object_vars(AuthMode::guard("member")->login($user->toArray()));
-            $shopData = [];
-            $cardState = 0;
-            if (!empty($param['shop']))
-            {
-                $shop = (new SaasShop)->where("shop_id", $param['shop'])->field("shop_name,start_at,end_at,vip_end,shop_status,shop_notice,line_time,status,shop_address")->findOrEmpty();
-                if ($shop->isEmpty()) return error("店铺已被关闭");
-                $currentTime = time();
-                $vipEndTime = strtotime($shop['vip_end'] ?? '');
-                $lineEndTime = strtotime("+10020000 min", strtotime($shop['line_time'] ?? ''));
-                $today = date('Y-m-d');
-                $startTime = strtotime("{$today} {$shop['start_at']}");
-                $endTime = strtotime("{$today} {$shop['end_at']}");
-                if ($currentTime > $vipEndTime){
-                    $status = ['text' => '已过期', 'val' => 0];
-                } else if ($shop['status'] == 2) {
-                    $status = ['text' => '已冻结', 'val' => 0];
-                } else if ($currentTime > $lineEndTime) {
-                    $status = ['text' => '已离线', 'val' => 0];
-                } else if ($currentTime > $endTime || $currentTime < $startTime) // 过了营业时间
-                {
-                    $status = ['text' => '休息中', 'val' => 0];
-                } else {
-                    $status = ['text' => '营业中', 'val' => 1];
-                }
-                $shop['status_text'] = $status['text'];
-                $shop['status_val'] = $status['val'];
-                $shop['time'] = ($shop['start_at'] == '00:00' && $shop['end_at'] == '23:59')
-                    ? '24小时营业'
-                    : date('H:i', $startTime) . '-' . date('H:i', $endTime);
-                if ($param['card'] == 1) { // 领取会员卡
-                    $cardInfo = (new SaasUser)->where("shop_id",$param['shop'])->where("openid",$userinfo['openid'])->findOrEmpty();
-                    if ($cardInfo->isEmpty()) {
-                        $cardInfo->insertGetId([
-                            "shop_id"   => $param['shop'],
-                            "openid"    => $userinfo['openid'],
-                            "card_no"   => CodeExtend::uniqidDate(16,"1088")
-                        ]);
-                        $cardState = 1;
-                    }
-                }
-                $shopData = $shop->toArray();
-            }
-            $share = sConf("wechat.share");
-            return success("ok",["shop" => $shopData,'user' => ['nickname' => $user['nickname']??'','avatar' => $user['avatar']??''],"token" => $userAuth,"card" => $cardState,"share" => $share]);
-        }catch (\Throwable $e){
-            echo $e->getMessage()."\n";
-            echo $e->getFile()."\n";
-            echo $e->getLine()."\n";
-            return error($e->getMessage());
-        }
-    }
-
-}

+ 48 - 0
app/controller/api/Page.php

@@ -3,6 +3,7 @@
 namespace app\controller\api;
 
 use app\extra\basic\Base;
+use app\model\system\SystemData;
 use LinFly\Annotation\Route\Controller;
 use LinFly\Annotation\Route\Route;
 use support\Request;
@@ -25,6 +26,16 @@ class Page extends Base
         }
     }
 
+    #[Route(path: "rule",methods: "get")]
+    public function getRule(Request $request)
+    {
+        try {
+            $data = sConf("page.rule");
+            return json_encode(['code' => 1,'data' => $data],JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
 
 
     #[Route(path: "privacy",methods: "get")]
@@ -50,4 +61,41 @@ class Page extends Base
         }
     }
 
+    /**
+     * 三级城市信息
+     * @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());
+        }
+    }
+
 }

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

@@ -0,0 +1,34 @@
+<?php
+
+namespace app\controller\api;
+
+use app\extra\basic\Base;
+use app\middleware\WxMiddleware;
+use LinFly\Annotation\Route\Controller;
+use LinFly\Annotation\Route\Middleware;
+use LinFly\Annotation\Route\Route;
+use support\Request;
+use support\Response;
+
+
+#[Controller(prefix: "/wx_api/portal"),Middleware(WxMiddleware::class)]
+class Portal extends Base
+{
+
+
+    /**
+     * 小程序首页信息
+     * @param Request $request
+     * @return Response
+     */
+    #[Route(path: "mini",methods: "get")]
+    public function getPortal(Request $request): Response
+    {
+        try {
+
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+}

+ 63 - 2
app/controller/api/School.php

@@ -3,19 +3,37 @@
 namespace app\controller\api;
 
 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_api/school"),Middleware(WxMiddleware::class)]
 class School extends Base
 {
 
-    protected array $noNeedLogin = ['getPortalData'];
+    protected array $noNeedLogin = ['getPortalData','getArticleDetail','getCategoryData'];
+
+    #[Inject]
+    protected CategoryService $service;
+
+    #[Inject]
+    protected BlueArticle $article;
+
+    #[Inject]
+    protected BlueCategory $category;
+
+    #[Inject]
+    protected ArticleService $articleService;
 
     /**
      * 商学院首页
@@ -23,10 +41,53 @@ class School extends Base
      * @return Response
      */
     #[Route(path: "portal",methods: "get")]
-    public function getPortalData(Request $request)
+    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());
         }

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

@@ -0,0 +1,34 @@
+<?php
+
+namespace app\controller\api;
+
+use app\extra\basic\Base;
+use app\middleware\WxMiddleware;
+use LinFly\Annotation\Route\Controller;
+use LinFly\Annotation\Route\Middleware;
+use LinFly\Annotation\Route\Route;
+use support\Request;
+use support\Response;
+
+
+#[Controller(prefix: "/wx_api/task"),Middleware(WxMiddleware::class)]
+class Task extends Base
+{
+
+
+    /**
+     * 任务列表
+     * @param Request $request
+     * @return Response
+     */
+    #[Route(path: "portal",methods: "get")]
+    public function getTaskList(Request $request): Response
+    {
+        try {
+
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+}

+ 17 - 0
app/extra/service/blue/ArticleService.php

@@ -27,6 +27,23 @@ class ArticleService extends Service
     }
 
 
+
+    /**
+     * 列表
+     * @param array $param
+     */
+    public function getSchoolList(array $param = [])
+    {
+        $this->mode = new BlueArticle();
+        return $this->searchVal($param,$this->searchFilter($param))->with(['categoryJoin' => function($query){
+            $query->field("id,name");
+        }])->field("id,title,category,view,zan,author,source,comment,cover")->paginate([
+            "list_rows" => $param['pageSize'],
+            "page"      => $param['page']
+        ]);
+    }
+
+
     /**
      *
      * @param array $param

+ 8 - 0
app/extra/service/blue/CategoryService.php

@@ -19,6 +19,14 @@ class CategoryService extends Service
         return $this->searchVal($param,$this->searchFilter($param))->select()->toArray();
     }
 
+    public function getPortalData(array $param = []): array
+    {
+        $this->mode = new BlueCategory();
+        return $this->searchVal($param,$this->searchFilter($param))->field("id,name,icon,small_icon")->with(['article' => function($query){
+            $query->whereJsonContains("attribute",['top'])->field('id,title,category,view,zan,author,source,comment,cover')->limit(10);
+        }])->whereJsonContains("attribute",['recommend'])->select()->toArray();
+    }
+
 
     /**
      *

+ 42 - 0
app/extra/tools/XcJob.php

@@ -0,0 +1,42 @@
+<?php
+
+namespace app\extra\tools;
+
+use yzh52521\EasyHttp\Http;
+
+class XcJob
+{
+
+
+
+    /**
+     * 默认header
+     * @var string[]
+     */
+    protected array $header = [
+        "content-type"  => "application/json"
+    ];
+
+    public function token(): static
+    {
+        $this->header = [
+            "cookie" => $this->getCookie()
+        ];
+        return $this;
+    }
+
+    /**
+     * @param string $jobId
+     * @return array
+     */
+    public function getJobDetail(string $jobId = ""): array
+    {
+        return Http::withHeaders($this->header)->get("https://www.xingtu.cn/gw/api/task/provider_get_project_detail",['project_id' => $jobId])->array();
+    }
+
+
+    protected function getCookie(): string
+    {
+        return "passport_csrf_token=dc2c5075e29c15785b2433afb8d9dd10; passport_csrf_token_default=dc2c5075e29c15785b2433afb8d9dd10; is_staff_user=false; has_biz_token=false; x-web-secsdk-uid=f676fb7e-81a3-42e2-b9e1-73c0ea919aea; csrf_session_id=5499e75e3f1f76a628c1efa81b7c89b3; tt_webid=7637860647254296090; Hm_lvt_5d77c979053345c4bd8db63329f818ec=1778328034; HMACCOUNT=DE9169EBCCD81810; Hm_lpvt_5d77c979053345c4bd8db63329f818ec=1778328167; passport_auth_status=93b289d15b8bb4866b32877a48a3b4b6%2C3a1cc997a270fa7b4f4fb3c3a79939fd; passport_auth_status_ss=93b289d15b8bb4866b32877a48a3b4b6%2C3a1cc997a270fa7b4f4fb3c3a79939fd; sid_guard=2cf53e24db19ce7e1d9094d82a7e0a15%7C1778328219%7C5184002%7CWed%2C+08-Jul-2026+12%3A03%3A41+GMT; uid_tt=b918d45f40210fd4799129be8d1e7ae1; uid_tt_ss=b918d45f40210fd4799129be8d1e7ae1; sid_tt=2cf53e24db19ce7e1d9094d82a7e0a15; sessionid=2cf53e24db19ce7e1d9094d82a7e0a15; sessionid_ss=2cf53e24db19ce7e1d9094d82a7e0a15; session_tlb_tag=sttt%7C15%7CLPU-JNsZzn4dkJTYKn4KFf_________SootvJEGr4tH2rLd7KSvG3gY4xtecQgysyxyTbEgz9BA%3D; sid_ucp_v1=1.0.0-KDlkNjI4ZDI4NTI2OTEyMzJiYWNjYTQwYzIyNmZlOWM5OTA0MjU3MjkKFwiUv5Cvv8yyBxCbxfzPBhj6EzgCQPEHGgJscSIgMmNmNTNlMjRkYjE5Y2U3ZTFkOTA5NGQ4MmE3ZTBhMTU; ssid_ucp_v1=1.0.0-KDlkNjI4ZDI4NTI2OTEyMzJiYWNjYTQwYzIyNmZlOWM5OTA0MjU3MjkKFwiUv5Cvv8yyBxCbxfzPBhj6EzgCQPEHGgJscSIgMmNmNTNlMjRkYjE5Y2U3ZTFkOTA5NGQ4MmE3ZTBhMTU; star_sessionid=d56971486bfb11538b9640768581fe1a";
+    }
+}

+ 36 - 0
app/functions.php

@@ -598,4 +598,40 @@ if (!function_exists('unique_arr')) {
         // 重置索引返回
         return array_values($tmp);
     }
+}
+
+if (!function_exists("format_money_bit"))
+{
+    /**
+     * 金额格式化:过万显示 万、百万、千万、亿
+     * @param float $money    原始金额
+     * @param int $decimal  保留几位小数
+     * @return string
+     */
+    function format_money_bit(float $money, int $decimal = 2): string
+    {
+        $money = (float)$money;
+
+        if ($money >= 100000000) {
+            // 亿
+            $result = number_format($money / 100000000, $decimal) . '亿';
+        } elseif ($money >= 10000000) {
+            // 千万
+            $result = number_format($money / 10000000, $decimal) . '千万';
+        } elseif ($money >= 1000000) {
+            // 百万
+            $result = number_format($money / 1000000, $decimal) . '百万';
+        } elseif ($money >= 10000) {
+            // 万
+            $result = number_format($money / 10000, $decimal) . '万';
+        } else {
+            // 小于1万,直接显示
+            $result = number_format($money, $decimal);
+        }
+
+        $result = rtrim($result, '0');
+        $result = rtrim($result, '.');
+
+        return $result;
+    }
 }

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

@@ -3,15 +3,16 @@
 namespace app\model\blue;
 
 use app\extra\basic\Model;
+use think\model\relation\HasMany;
 
 
 /**
- * @property integer $id (主键)
- * @property string $name 名称
- * @property string $icon 普通图标
- * @property string $small_icon 小图标
- * @property integer $sort 排序
- * @property integer $type 1任务2文章
+ * @property integer $id (主键)
+ * @property string $name 名称
+ * @property string $icon 普通图标
+ * @property string $small_icon 小图标
+ * @property integer $sort 排序
+ * @property integer $type 1任务2文章
  * @property mixed $create_at 创建时间
  */
 class BlueCategory extends Model
@@ -44,5 +45,9 @@ class BlueCategory extends Model
      */
     public bool $timestamps = false;
 
+    public function article(): HasMany
+    {
+        return $this->hasMany(BlueArticle::class,"category","id");
+    }
 
 }

+ 33 - 0
app/validate/blue/ExpertGroupValidate.php

@@ -0,0 +1,33 @@
+<?php
+
+namespace app\validate\blue;
+
+use think\Validate;
+
+class ExpertGroupValidate extends Validate
+{
+
+
+    protected $rule = [
+        "truenname"     => "require",
+        "mobile"        => "require|mobile",
+        "city"          => "require",
+        "city_path"     => "require",
+        "team"          => "require",
+    ];
+
+
+    protected $message = [
+        "truenname.require"     => "请输入姓名",
+        "mobile.require"        => "请输入手机号码",
+        "mobile.mobile"         => "手机号有误",
+        "city.require"          => "请选择城市",
+        "city_path.require"     => "请选择城市",
+        "team.require"          => "请选择团队",
+    ];
+    protected $scene = [
+        'add'  =>  ['truenname','mobile','city','city_path','team'],
+    ];
+
+
+}

+ 39 - 0
app/validate/blue/ExpertValidate.php

@@ -0,0 +1,39 @@
+<?php
+
+namespace app\validate\blue;
+
+use think\Validate;
+
+class ExpertValidate extends Validate
+{
+
+
+
+    protected $rule = [
+        "truenname"     => "require",
+        "idcard"        => "require|idCard",
+        "mobile"        => "require|mobile",
+        "city"          => "require",
+        "city_path"     => "require",
+        "sex"           => "require",
+        "married"       => "require",
+        "child"         => "require",
+        "pet"           => "require",
+    ];
+
+
+    protected $message = [
+        "truenname.require"     => "请输入姓名",
+        "idcard.require"        => "请输入身份证号",
+        "idcard.idCard"         => "身份证号有误",
+        "mobile.require"        => "请输入手机号码",
+        "mobile.mobile"         => "手机号有误",
+        "city.require"          => "请选择城市",
+        "city_path.require"     => "请选择城市",
+        "pet.require"           => "请选择宠物",
+    ];
+    protected $scene = [
+        'add'  =>  ['truenname','idcard','mobile','city','city_path','sex','married','child','pet'],
+    ];
+
+}

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
city.json


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است