Zory пре 3 часа
родитељ
комит
c6a0429b34

+ 84 - 0
app/controller/admin/Deposit.php

@@ -0,0 +1,84 @@
+<?php
+
+namespace app\controller\admin;
+
+use app\extra\basic\Base;
+use app\extra\tools\CodeExtend;
+use app\middleware\AuthMiddleware;
+use app\model\saas\SaasDepositLog;
+use app\model\saas\SaasStore;
+use app\service\saas\DepositService;
+use DI\Attribute\Inject;
+use LinFly\Annotation\Attributes\Route\Controller;
+use LinFly\Annotation\Attributes\Route\GetMapping;
+use LinFly\Annotation\Attributes\Route\Middleware;
+use LinFly\Annotation\Attributes\Route\PostMapping;
+use support\Request;
+use support\Response;
+
+/**
+ * 保证金
+ */
+#[Controller("/api/deposit"),Middleware(AuthMiddleware::class)]
+class Deposit extends Base
+{
+
+    #[Inject]
+    protected DepositService $service;
+
+    #[Inject]
+    protected SaasDepositLog $model;
+
+    #[GetMapping('list')]
+    public function getDataList(Request $request): Response
+    {
+        try {
+            $param = $request->all();
+            $data = $this->service->setModel()->getList($param,['poi' => function($query){
+                $query->field("poi_id,poi_name,poi_address,nick_name");
+            }]);
+            return successTrans(100010,pageFormat($data),200);
+        } catch (\Throwable $th) {
+            return error($th->getMessage());
+        }
+    }
+
+    #[PostMapping("save")]
+    public function setDepositData(Request $request): Response
+    {
+        try {
+            $param = $this->_valid([
+                "poi_id.require"    => trans("empty.require"),
+                "type.require"      => trans("empty.require"),
+                "money.require"     => trans("empty.require"),
+            ],$request->method());
+            if (!is_array($param)) return error($param);
+            $store = (new SaasStore)->where("poi_id",$param['poi_id'])->findOrEmpty();
+            if ($store->isEmpty()) return error("该商家不存在");
+            switch ($param['type']) {
+                case "1": // 新增金额
+                case "3":
+                case "5":
+                    $store->deposit = $store['deposit'] + ($param['money'] * 100);
+                    break;
+                default:
+                    if (($param['money'] * 100) > $store['deposit']) return error("商家保证金余额不足");
+                    $store->deposit = $store['deposit'] - ($param['money'] * 100);
+                    break;
+            }
+            $store->save();
+            $state = $this->model->insertGetId([
+                "poi_id"    => $param['poi_id'],
+                "order_sn"  => strtoupper(CodeExtend::random(18,3)),
+                "money"     => $param['money'] * 100,
+                "type"      => $param['type'],
+                "status"    => 1
+            ]);
+            if (!$state) return errorTrans("error.data");
+            return successTrans("success.data");
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+}

+ 117 - 0
app/controller/admin/Finance.php

@@ -0,0 +1,117 @@
+<?php
+
+namespace app\controller\admin;
+
+use app\extra\basic\Base;
+use app\middleware\AuthMiddleware;
+use app\model\saas\SaasBankCompany;
+use app\model\saas\SaasStoreOpen;
+use LinFly\Annotation\Attributes\Route\Controller;
+use LinFly\Annotation\Attributes\Route\GetMapping;
+use LinFly\Annotation\Attributes\Route\Middleware;
+use LinFly\Annotation\Attributes\Route\PostMapping;
+use support\Request;
+use support\Response;
+
+
+#[Controller("/api/finance"),Middleware(AuthMiddleware::class)]
+class Finance extends Base
+{
+
+
+    /**
+     * 三级城市信息
+     * @param Request $request
+     * @return Response
+     */
+    #[GetMapping("city")]
+    public function getCityJson(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());
+        }
+    }
+
+
+    #[GetMapping("code")]
+    public function getCodeData(Request $request): Response
+    {
+        try {
+            $param = $this->_valid([
+                "name.require"  => trans("empty.require")
+            ],$request->method());
+            if (!is_array($param)) return error($param);
+            $data = (new SaasBankCompany)->where("name","like","%{$param['name']}%")->select()->toArray();
+            if (empty($data)) return error("无数据");
+            return successTrans("success.data",$data);
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+
+    #[GetMapping("open")]
+    public function getCodeOpen(Request $request): Response
+    {
+        try {
+            $data = (new SaasStoreOpen)->where("poi_id",$request->user['store_id'])->select()->toArray();
+            return successTrans("success.data",$data);
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+    /**
+     * 虚拟户进件提交
+     * @param Request $request
+     * @return Response
+     */
+    #[PostMapping("save")]
+    public function setOpenData(Request $request): Response
+    {
+        try {
+            $param = $this->_valid([
+                "company_name.require"      => trans("empty.require"),
+                "company_sub_name.require"  => trans("empty.require"),
+                "company_number.require"    => trans("empty.require"),
+                "company_license.require"   => trans("empty.require"),
+                "city.require"              => trans("empty.require"),
+                "city_name.require"         => trans("empty.require"),
+                "address.require"           => trans("empty.require"),
+                "legal_mobile.require"      => trans("empty.require"),
+                "legal_mobile.mobile"       => trans("error.mobile"),
+                "legal_name.require"        => trans("empty.require"),
+                "legal_idcard.require"      => trans("empty.require"),
+                "legal_idcard.idCard"       => trans("error.idcard"),
+                "email.require"             => trans("empty.require"),
+                "email.email"               => trans("error.email"),
+                "legal_id_front.require"    => trans("empty.require"),
+                "legal_id_back.require"     => trans("empty.require"),
+                "bank_img.require"          => trans("empty.require"),
+                "bank_number.require"       => trans("empty.require"),
+                "bank_code.require"         => trans("empty.require"),
+            ],$request->method());
+            if (!is_array($param)) return error($param);
+            if (!empty($param['city'])) $param['city_code'] = json_encode($param['city']);
+            if (!empty($param['city_name'])) $param['city_name'] = trim($param['city_name']);
+            $data = (new SaasStoreOpen)->where("poi_id",$request->user['store_id'])->findOrEmpty();
+            $param['last_at'] = getDateFull();
+            if ($data->isEmpty())
+            {
+                $param['poi_id'] = $request->user['store_id'];
+                $state = $data->setAutoData($param);
+            } else {
+                if ($data['status'] == 1) return error("无需重复进件");
+                $state = $data->save($param);
+            }
+            if (!$state) return errorTrans("error.data");
+            return success("提交成功,请耐心等待审核");
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+}

+ 6 - 0
app/controller/admin/Order.php

@@ -38,6 +38,12 @@ class Order extends Base
                     }
                     return $productTypeArr[$resp['product_type']]??'';
                 }]);
+            },'user' => function($query){
+                $query->field("openid,nickname,avatar");
+            },'poi' => function($query){
+                $query->field("poi_id,poi_name,poi_address,nick_name");
+            }],true,['end_time'],["end_time" => function ($resp,$next) {
+                return timeDiff(strtotime("+30 minutes",strtotime($next['create_at'])),time());
             }]);
             return successTrans("success.data",pageFormat($data),200);
         } catch (\Throwable $throwable) {

+ 2 - 1
app/controller/api/Goods.php

@@ -39,7 +39,7 @@ class Goods extends Base
             echo getDateFull()."===>商品详情\n";
             echo json_encode($param)."\n";
             $data = $this->model->where("product_id",$param['goods'])->with(['poi' => function ($query) {
-                $query->field("poi_id,poi_name,poi_address,longitude,latitude,service_mobile,start_at,end_at");
+                $query->field("poi_id,poi_name,poi_address,longitude,latitude,service_mobile,start_at,end_at,status");
             },'skuSpecs'])->append(['otherImg'])->withAttr(['otherImg' => function ($qu,$resp) {
                 $img = json_decode($resp['image_list'],true);
                 return array_map(function ($v) {
@@ -47,6 +47,7 @@ class Goods extends Base
                 }, $img);
             }])->findOrEmpty();
             if ($data->isEmpty()) return errorTrans("empty.data");
+            if ($data['poi']['status'] <> 1) return error("该店铺已关闭,请联系管理员");
             return $this->encode("success",$data->toArray());
         } catch (\Throwable $th) {
             return error($th->getMessage());

+ 1 - 1
app/controller/api/Home.php

@@ -25,7 +25,7 @@ class Home extends Base
     /**
      * @var array|string[]
      */
-    protected array $noNeedLogin = ["getHomeData","getLicense","payBtnMobile","getMoreGoods"];
+    protected array $noNeedLogin = ["getHomeData","getLicense","payBtnMobile","getMoreGoods","getCityJson"];
 
     #[GetMapping("data")]
     public function getHomeData(Request $request): Response

+ 5 - 3
app/controller/api/Service.php

@@ -92,13 +92,15 @@ class Service extends Base
                     "poi_name"  => $store['poi_name'],
                     "openid"    => $request->user['openid'],
                     "service_id"    => $service['id'],
-                    "order"    => $param['order']??'',
-                    "goods"    => $param['goods']??''
+                    "order"     => $param['order']??'',
+                    "goods"     => $param['goods']??'',
+                    "last_at"   => getDateFull()
                 ]);
             } else {
                 $chatStore->service_id = $service['id'];
                 $chatStore->order = $param['order']??'';
                 $chatStore->goods = $param['goods']??'';
+                $chatStore->last_at = getDateFull();
                 $chatStore->save();
             }
             return $this->encode("ok",['store' => $store,'code' => 1,'sendId' => $request->user['openid'],'msg' => pageFormatMsg($msg),"serviceId" => $service['id'],'avatar' => $userAvatar]); // 客服在线
@@ -155,7 +157,7 @@ class Service extends Base
                 "sendId.require"    => trans("empty.require"),
             ],"post");
             if (!is_array($param)) return error($param);
-            $state = (new SaasChatMsg)->insertGetId([
+            (new SaasChatMsg)->insertGetId([
                 "source"    => 1,
                 "openid"    => $request->user['openid'],
                 "content"   => is_array($param['content'])?json_encode($param['content']):$param['content'],

+ 7 - 0
app/controller/api/Solution.php

@@ -40,6 +40,13 @@ class Solution extends Base
                     $goods->status = 1;
                     $goods->save();
                 }
+                if ($data['status'] == "FAIL") { // 审核拒绝
+                    $goods = (new SaasGoods)->where("goods_id",$data['product_id'])->findOrEmpty();
+                    if ($goods->isEmpty()) return json(['err_no' => 0,"err_tips" => "success"]);
+                    $goods->status = 4;
+                    $goods->reason = $data['reason'];
+                    $goods->save();
+                }
             }
             if (isset($data['type']))
             {

+ 52 - 0
app/controller/merchant/Deposit.php

@@ -0,0 +1,52 @@
+<?php
+
+namespace app\controller\merchant;
+
+use app\extra\basic\Base;
+use app\middleware\AuthMiddleware;
+use app\model\saas\SaasStore;
+use app\service\saas\DepositService;
+use DI\Attribute\Inject;
+use LinFly\Annotation\Attributes\Route\Controller;
+use LinFly\Annotation\Attributes\Route\GetMapping;
+use LinFly\Annotation\Attributes\Route\Middleware;
+use support\Request;
+use support\Response;
+
+/**
+ * 保证金
+ */
+
+#[Controller("/api/merchant/deposit"),Middleware(AuthMiddleware::class)]
+class Deposit extends Base
+{
+
+    #[Inject]
+    protected DepositService $service;
+
+    #[GetMapping('list')]
+    public function getDataList(Request $request): Response
+    {
+        try {
+            $param = $request->all();
+            $param['poi_id'] = $request->user['store_id'];
+            $data = $this->service->setModel()->getList($param);
+            return successTrans(100010,pageFormat($data),200);
+        } catch (\Throwable $th) {
+            return error($th->getMessage());
+        }
+    }
+
+
+    #[GetMapping('data')]
+    public function getDepositData(Request $request): Response
+    {
+        try {
+            $deposit = (new SaasStore)->where("poi_id",$request->user['store_id'])->value("deposit");
+            return success('ok',compact("deposit"));
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+}

+ 20 - 0
app/controller/merchant/Finance.php

@@ -0,0 +1,20 @@
+<?php
+
+namespace app\controller\merchant;
+
+use app\extra\basic\Base;
+use app\middleware\AuthMiddleware;
+use LinFly\Annotation\Attributes\Route\Controller;
+use LinFly\Annotation\Attributes\Route\GetMapping;
+use LinFly\Annotation\Attributes\Route\Middleware;
+use support\Request;
+use support\Response;
+
+
+#[Controller("/api/merchant/finance"),Middleware(AuthMiddleware::class)]
+class Finance extends Base
+{
+
+
+
+}

+ 14 - 4
app/controller/merchant/Goods.php

@@ -41,6 +41,7 @@ class Goods extends Base
         try {
             $param = $request->all();
             $param['poi_id'] = $request->user['store_id'];
+            if (!empty($param['status'])) $param['status'] = intval($param['status']+1);
             $productType = $this->service->productType();
             $data = $this->service->setModel()->getList($param,null,true,['types'],['types' => function($query,$resp) use($productType){
                 $productTypeArr = [];
@@ -157,6 +158,11 @@ class Goods extends Base
             $param['spu_id'] = CodeExtend::uniqidDate(18);
             unset($param['skuSpecs']);
             $param['line_price'] = $param['line_price'] * 100;
+            if (empty($param['notification']))  return error("请最少添加一组添加使用规则");
+            foreach (json_decode($param['notification'],true) as $key => $value) {
+                if (empty($value['title'])) return error("规则标题不能为空");
+                if (empty($value['content'])) return error("规则内容不能为空");
+            }
             $store = (new SaasStore)->where("poi_id",$request->user['store_id'])->findOrEmpty();
             if ($store->isEmpty()) return errorTrans("error.data");
             // 获取attr_key_value_map参数
@@ -171,7 +177,6 @@ class Goods extends Base
                 "secret"    => sConf("wechat.mini_secret"),
             ])->token()->createGoodsData($param,$skuData,$store->toArray(),$valMap);
 //            return errorTrans("error.data");
-            print_r($data);
             if (empty($data['product_id'])) return error($data['description']);
             $param['goods_id'] = $data['product_id'];
 //            return errorTrans("error.data");
@@ -215,8 +220,13 @@ class Goods extends Base
     }
 
 
+    /**
+     * 商品下架
+     * @param Request $request
+     * @return Response
+     */
     #[PostMapping("off")]
-    public function offGood2Life(Request $request)
+    public function offGood2Life(Request $request): Response
     {
         try {
             $param = $this->_valid([
@@ -233,8 +243,8 @@ class Goods extends Base
                 "secret"    => sConf("wechat.mini_secret"),
             ])->token()->goodsOffOn(2,$store['store_id'],$detail['goods_id']);
             if ($data['error_code'] <> 0) return error("操作失败,请稍后重试");
-//            $detail->status = 1;
-//            $detail->save();
+            $detail->status = 2;
+            $detail->save();
             return successTrans("success.data");
         } catch (\Throwable $throwable) {
             return error($throwable->getMessage());

+ 102 - 23
app/controller/merchant/Plan.php

@@ -18,6 +18,7 @@ use LinFly\Annotation\Attributes\Route\PostMapping;
 use support\Request;
 use support\Response;
 use function DI\get;
+use function Laravel\Prompts\number;
 
 
 #[Controller("/api/merchant/plan"),Middleware(AuthMiddleware::class)]
@@ -71,7 +72,7 @@ class Plan extends Base
             $liveDyStar = $liveDyGoods = [];
             foreach ($goodsData as $k => $v) {
                 $liveDyGoods[$k] = [
-                    "commission_rate"   => $v['rate'] * 100,
+                    "commission_rate"   => round($v['rate'] * 100),
                     "product_id"        => $v['goods_id'],
                 ];
             }
@@ -170,28 +171,106 @@ class Plan extends Base
             $plan = $this->model->where("id",$param['id'])->findOrEmpty();
             if ($plan->isEmpty()) return errorTrans("empty.data");
             if ($plan['poi_id'] <> $request->user['store_id']) return error("非法操作"); // return errorTrans("empty.data");
-            print_r($param);
-            return errorTrans("error.data");
-//            $goods = (new SaasLivePlanGoods)->where(['plan_id' => $plan['plan_id'],'goods_id' => $param['goods_id']])->findOrEmpty();
-//            if ($goods->isEmpty()) return error("商品不存在"); // return errorTrans("empty.data");
-//            $resp = (new PlanLive)->config([
-//                "appid"     => sConf("wechat.mini_appid"),
-//                "secret"    => sConf("wechat.mini_secret"),
-//            ])->token()->planData($plan['plan_id'],[
-//                'name'      => $plan['plan_name'],
-//                'mobile'    => $plan['merchant_phone'],
-//                'goods'     => [
-//                    [
-//                        "commission_rate"   => $param['commission_rate'] * 100,
-//                        "product_id"        => $param['goods_id']
-//                    ]
-//                ],
-//            ]);
-//            print_r($resp);
-//            if (isset($resp['msg'])) return error($resp['msg']);
-//            $state = $goods->save(['commission_rate' => $param['commission_rate']]);
-//            if (!$state) return errorTrans("error.data");
-//            return successTrans("success.data");
+            $planData = is_string($param['data']) ? json_decode($param['data'],true) : $param['data'];
+            $editData = [];
+            $editPlanData = [
+                'name'      => $plan['plan_name'],
+                'mobile'    => $plan['merchant_phone'],
+            ];
+            if ($param['type'] == 'goods') {
+                foreach ($planData as $k => $v) {
+                    $commission_rate = $v['commission_rate'] * 100;
+                    echo $commission_rate."\n";
+                    $editData[$k] = [
+                        "commission_rate"   => round($commission_rate),
+                        "product_id"        => $v['goods_id'],
+                    ];
+                }
+                $editPlanData['goods'] = $editData;
+            }
+            if ($param['type'] == 'star') {
+                foreach ($planData as $k => $v) {
+                    $editData[$k] = $v['unique_id'];
+                }
+                $editPlanData['star'] = $editData;
+            }
+            $resp = (new PlanLive)->config([
+                "appid"     => sConf("wechat.mini_appid"),
+                "secret"    => sConf("wechat.mini_secret"),
+            ])->token()->planData($plan['plan_id'],$editPlanData);
+            if (isset($resp['msg'])) return error($resp['msg']);
+            $goodsAll = $starAll = [];
+            $state = false;
+            if ($param['type'] == 'goods') {
+                (new SaasLivePlanGoods)->where("plan_id",$plan['plan_id'])->delete();
+                foreach ($planData as $k => $v) {
+                    $goodsAll[$k] = [
+                        "plan_id"           => $resp['plan_id'],
+                        "goods_id"          => $v['goods_id'],
+                        "commission_rate"   => $v['commission_rate'],
+                    ];
+                }
+                $state = (new SaasLivePlanGoods)->insertAll($goodsAll);
+            }
+            if ($param['type'] == 'star') {
+                (new SaasLivePlanStar)->where("plan_id",$plan['plan_id'])->delete();
+                foreach ($planData as $k => $v) {
+                    $starAll[$k] = [
+                        "plan_id"   => $resp['plan_id'],
+                        "unique_id" => $v
+                    ];
+                }
+                $state = (new SaasLivePlanStar)->insertAll($starAll);
+            }
+            if (!$state) return errorTrans("error.data");
+            return successTrans("success.data");
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+
+    #[PostMapping('close')]
+    public function closePlan(Request $request): Response
+    {
+        try {
+            $param = $this->_valid([
+                "id.require"        => trans("empty.require"),
+            ],$request->method());
+            if (!is_array($param)) return error($param);
+            $plan = $this->model->where("id",$param['id'])->findOrEmpty();
+            if ($plan->isEmpty()) return errorTrans("empty.data");
+            if ($plan['poi_id'] <> $request->user['store_id']) return error("非法操作");
+            $resp = (new PlanLive)->config([
+                "appid"     => sConf("wechat.mini_appid"),
+                "secret"    => sConf("wechat.mini_secret"),
+            ])->token()->planClose($plan['plan_id']);
+            if (isset($resp['msg'])) return error($resp['msg']);
+            $plan->status = 2;
+            $state = $plan->save();
+            if (!$state) return errorTrans("error.data");
+            return successTrans("success.data");
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+
+    #[PostMapping('del')]
+    public function delPlan(Request $request): Response
+    {
+        try {
+            $param = $this->_valid([
+                "id.require"        => trans("empty.require"),
+            ],$request->method());
+            if (!is_array($param)) return error($param);
+            $plan = $this->model->where("id",$param['id'])->findOrEmpty();
+            if ($plan->isEmpty()) return errorTrans("empty.data");
+            if ($plan['poi_id'] <> $request->user['store_id']) return error("非法操作");
+            if  ($plan['status'] <> 2) return error("该计划暂不支持删除");
+            $state = $plan->delete();
+            if (!$state) return errorTrans("error.data");
+            return successTrans("success.data");
         } catch (\Throwable $throwable) {
             return error($throwable->getMessage());
         }

+ 6 - 2
app/controller/service/Service.php

@@ -30,10 +30,12 @@ class Service extends Base
     #[Inject]
     protected SaasChatStore $model;
 
-
     #[Inject]
     protected GoodsService $goodsService;
 
+
+//    protected array $noNeedLogin = ["getServiceData"];
+
     #[GetMapping('list')]
     public function getServiceData(Request $request): Response
     {
@@ -42,6 +44,8 @@ class Service extends Base
             $param = $request->all();
             $param['poi_id'] = $request->user['store_id'];
             $param['service_id'] = $request->user['id'];
+            $param['order'] = "descending";
+            $param['field'] = "last_at";
             $data = $this->service->setModel()->getList($param,['user' => function($query){
                 $query->field("openid,nickname,avatar,mobile,create_at");
             }],true,['last','avatar'],['last' => function($data,$resp) use($param){
@@ -49,7 +53,7 @@ class Service extends Base
                 if ($last->isEmpty()) {
                     return ['type' => "text","content"=>"无",'num' => 0,'time' => time(),"create_at"=> formatTime(date("Y-m-d H:i:s",time()))];
                 }
-                return ["content"=> $last['content'],'num' => 0,"create_at"=> formatTime($last['create_at']),"time"=> strtotime($last['create_at']),'type' => $last['type']];
+                return ["content"=> hide_str($last['content']),'num' => 0,"create_at"=> formatTime($last['create_at']),"time"=> strtotime($last['create_at']),'type' => $last['type']];
             },'avatar' => function(){
                 return "https://washmy.oss-cn-guangzhou.aliyuncs.com/storage/20260511/23627b2cb8f73a8a90b95c31d726e6ecad0cbb9a.png";
             }]);

+ 19 - 0
app/extra/dyMini/PlanLive.php

@@ -30,6 +30,25 @@ class PlanLive extends BasicLife
         return $this->curlPostApi("api/match/v2/poi/save_live_oriented_plan/",$param);
     }
 
+
+    /**
+     * 取消计划
+     * @param int $planId
+     * @return array
+     */
+    public function planClose(int $planId = 0): array
+    {
+        $param = [
+            "plan_update_list"  => [
+                [
+                    "plan_id"   => $planId,
+                    "status"    => 3
+                ]
+            ]
+        ];
+        return $this->curlPostApi("api/match/v2/poi/update_oriented_plan_status/",$param);
+    }
+
     /**
      * 查下是否为cps订单
      * @param string $order

+ 45 - 0
app/model/saas/SaasBankCompany.php

@@ -0,0 +1,45 @@
+<?php
+
+namespace app\model\saas;
+
+use app\extra\basic\Model;
+
+
+/**
+ * @property integer $id (主键)
+ * @property string $name 
+ * @property string $sub_name 
+ * @property string $bank_code
+ */
+class SaasBankCompany 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 = "saas_bank_company";
+    
+    /**
+     * 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;
+
+
+}

+ 53 - 0
app/model/saas/SaasDepositLog.php

@@ -0,0 +1,53 @@
+<?php
+
+namespace app\model\saas;
+
+use app\extra\basic\Model;
+use think\model\relation\HasOne;
+
+
+/**
+ * @property integer $id (主键)
+ * @property mixed $poi_id 
+ * @property mixed $order_sn 
+ * @property integer $money 
+ * @property integer $status 1生效0待处理
+ * @property integer $type 
+ * @property mixed $create_at
+ */
+class SaasDepositLog 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 = "saas_deposit_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;
+
+    public function poi(): HasOne
+    {
+        return $this->hasOne(SaasStore::class, 'poi_id', 'poi_id');
+    }
+
+}

+ 50 - 0
app/model/saas/SaasStoreAccount.php

@@ -0,0 +1,50 @@
+<?php
+
+namespace app\model\saas;
+
+use app\extra\basic\Model;
+
+
+/**
+ * @property integer $id (主键)
+ * @property mixed $poi_id 
+ * @property integer $type 1个人2企业
+ * @property string $truename 名字
+ * @property string $idcard 身份证或营业执照
+ * @property mixed $content 其他数据
+ * @property integer $status 
+ * @property mixed $member_id 三方ID
+ * @property mixed $create_at
+ */
+class SaasStoreAccount 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 = "saas_store_account";
+    
+    /**
+     * 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;
+
+
+}

+ 63 - 0
app/model/saas/SaasStoreOpen.php

@@ -0,0 +1,63 @@
+<?php
+
+namespace app\model\saas;
+
+use app\extra\basic\Model;
+
+
+/**
+ * @property integer $id (主键)
+ * @property mixed $poi_id 
+ * @property string $company_name 
+ * @property mixed $company_number 
+ * @property string $company_sub_name 
+ * @property string $company_license 营业执照
+ * @property string $city_name 
+ * @property mixed $city_code 
+ * @property string $address 
+ * @property string $legal_name 法人姓名
+ * @property mixed $legal_mobile 
+ * @property mixed $legal_idcard 身份证号
+ * @property string $legal_id_front 正面
+ * @property string $legal_id_back 反面
+ * @property mixed $email 
+ * @property mixed $bank_number 对公帐号
+ * @property string $bank_code 开户行编码
+ * @property string $bank_img 开户许可证照片
+ * @property integer $status 
+ * @property string $remark 
+ * @property mixed $last_at 
+ * @property mixed $create_at
+ */
+class SaasStoreOpen 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 = "saas_store_open";
+    
+    /**
+     * 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;
+
+
+}

+ 50 - 0
app/model/saas/SaasTransactionLog.php

@@ -0,0 +1,50 @@
+<?php
+
+namespace app\model\saas;
+
+use app\extra\basic\Model;
+
+
+/**
+ * @property integer $id (主键)
+ * @property mixed $poi_id 
+ * @property mixed $order_sn 
+ * @property integer $star_money 达人佣金
+ * @property float $star_rate 达人佣金比例
+ * @property integer $system_money 系统扣点
+ * @property float $system_rate 系统扣点比例
+ * @property mixed $star_plan 佣金计划ID
+ * @property mixed $create_at
+ */
+class SaasTransactionLog 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 = "saas_transaction_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;
+
+
+}

+ 1 - 1
app/service/saas/ChatStoreService.php

@@ -11,7 +11,7 @@ class ChatStoreService extends Service
      *
      * @return $this
      */
-    public function setModel()
+    public function setModel(): static
     {
         $this->mode = (new SaasChatStore);
         return $this;

+ 38 - 0
app/service/saas/DepositService.php

@@ -0,0 +1,38 @@
+<?php
+
+namespace app\service\saas;
+
+use app\extra\basic\Service;
+use app\model\saas\SaasDepositLog;
+
+class DepositService extends Service
+{
+
+
+    /**
+     *
+     * @return $this
+     */
+    public function setModel(): static
+    {
+        $this->mode = (new SaasDepositLog);
+        return $this;
+    }
+
+
+    /**
+     *
+     * @param array $param
+     * @return array
+     */
+    public function searchFilter(array $param = []): array
+    {
+        $filter = [];
+        !empty($param['poi_id']) && $filter[] = ["poi_id", '=', $param['poi_id']];
+        !empty($param['status']) && $filter[] = ["status", '=', $param['status']];
+        !empty($param['type']) && $filter[] = ["type", '=', $param['type']];
+        return $filter;
+    }
+
+
+}

+ 1 - 1
app/service/saas/GoodsService.php

@@ -43,7 +43,7 @@ class GoodsService extends Service
     public function searchFilter(array $param = []): array
     {
         $filter = [];
-        !empty($param['status']) && $filter[] = ["status", '=', $param['status']];
+        !empty($param['status']) && $filter[] = ["status", '=', ($param['status']-1)];
         !empty($param['poi_id']) && $filter[] = ["poi_id", '=', $param['poi_id']];
         !empty($param['name']) && $filter[] = ["product_name", 'like', "%{$param['name']}%"];
         return $filter;

+ 1 - 0
app/service/saas/StarService.php

@@ -29,6 +29,7 @@ class StarService extends Service
         $filter = [];
         !empty($param['name']) && $filter[] = ["nick_name", 'like', "%{$param['name']}%"];
         !empty($param['unique']) && $filter[] = ["unique", 'like', "%{$param['unique_id']}%"];
+        !empty($param['poi_id']) && $filter[] = ["poi_id", '=', $param['poi_id']];
         return $filter;
     }
 

+ 4 - 4
config/plugin/webman/push/route.php

@@ -75,10 +75,10 @@ Route::post(parse_url(config('plugin.webman.push.app.channel_hook'), PHP_URL_PAT
     }
 
     // 业务根据需要处理上下线的channel,例如将在线状态写入数据库,通知其它channel等
-    // 上线的所有channel
-    echo 'online channels: ' . implode(',', $channels_online) . "\n";
-    // 下线的所有channel
-    echo 'offline channels: ' . implode(',', $channels_offline) . "\n";
+//    // 上线的所有channel
+//    echo 'online channels: ' . implode(',', $channels_online) . "\n";
+//    // 下线的所有channel
+//    echo 'offline channels: ' . implode(',', $channels_offline) . "\n";
 
     return 'OK';
 });

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

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