Zory hai 2 semanas
pai
achega
4232a744dc

+ 2 - 36
app/controller/common/Login.php

@@ -63,16 +63,7 @@ class Login extends Base
         $user = (new SystemUser)->where($map)->findOrEmpty();
         if ($user->isEmpty()) return [0,trans("error.user-empty"),[]];
         if ($user['status'] <> 1) return [0,trans("error.user-status"),[]];
-        if ($user['type'] > 1) {
-            $typeUser = $this->getTypeUser($user['store_id']);
-            if (empty($typeUser)) return [0,trans("empty.agent"),[]];
-            if ($typeUser['status'] <> 1) return [0,trans("error.agent"),[]];
-            if (time() > strtotime($typeUser['vip_end'])) return [0,trans("error.agent-out"),[]];
-            $user['shop_name'] = $typeUser['poi_name'];
-        }
-        if ($type == 2) {
-            if (md5($param['password'].$user['salt']) <> $user['password']) return [0,trans("error.passwd"),[]];
-        }
+        if (md5($param['password'].$user['salt']) <> $user['password']) return [0,trans("error.passwd"),[]];
         $user->login_at = getDateFull();
         $user->login_ip = request()->getRealIp();
         $user->login_num = Db::raw("login_num+1");
@@ -80,42 +71,17 @@ class Login extends Base
         return [1,'success',$user->toArray()];
     }
 
-
-    /**
-     * 获取代理信息
-     * @param int $agentId
-     * @return array
-     */
-    protected function getTypeUser(int $agentId = 0): array
-    {
-        return (new SaasStore)->where("poi_id",$agentId)->findOrEmpty()->toArray();
-    }
-
     #[GetMapping('profile')]
     public function getLoginUser(): Response
     {
         try {
             $userData = (new Auth)->guard("admin")->user()->toArray();
             if (isset($userData['password'])) unset($userData['password']);
-            $agent = (new SaasStore)->where("poi_id",$userData['store_id'])->findOrEmpty();
-            if (empty($agent['vip_end']))
-            {
-                $userData['vip_end'] = 0;
-            } else {
-                $userData['vip_end'] = strtotime($agent['vip_end']);
-            }
             return successTrans("success.data",[
                 "username"  => $userData['username'],
                 "userId"    => $userData['id'],
                 "truename"  => $userData['truename'],
-                "vip_at"    => $userData['vip_end'],
-                "agent_id"  => $userData['agent_id'],
-                "store_id"  => $userData['store_id'],
-                "super"     => $userData['is_super'],
-                "shop"      => $agent['poi_name']??'',
-                "trade"     => $agent['trade_type']??0,
-                "type"      => $userData['type'],
-                "logo"      => $agent['poi_logo']??'-'
+                "super"     => $userData['is_super']
             ]);
         } catch (\Throwable $throwable) {
             return error($throwable->getMessage());

+ 4 - 4
app/controller/common/Menu.php

@@ -30,18 +30,18 @@ class Menu extends Base
     {
         try {
             $param = $this->_valid([
-                "form.default"  => $request->user['type'],
                 "type.default"  => 1
             ]);
             $hide = 0;
-            $menu = $this->service->getMenuList($request->user['is_super'],$hide,$param['form']);
+            $menus = $this->service->getMenuList($request->user['is_super'],$hide);
+            if (function_exists("admin_menu_filter")) $menus = call_user_func("admin_user_filter",$menus);
             $permissionsData = [];
-            foreach ($menu as $val) {
+            foreach ($menus as $val) {
                 if ($val['type'] == 'button') {
                     $permissionsData[] = $val['name'];
                 }
             }
-            $menu = $this->filterMenu(DataExtend::arr2tree($menu),$param['type']);
+            $menu = $this->filterMenu(DataExtend::arr2tree($menus),$param['type']);
             if($param['type'] == 1) {
                 $permissions = $permissionsData;
                 $dashboardGrid = [];

+ 3 - 7
app/extra/basic/Base.php

@@ -189,16 +189,12 @@ class Base
                 "title"     => $menu['title'],
                 "icon"      => $menu['icon']??'',
                 "type"      => $menu['type'],
-                "hidden"    => !($menu['hide'] == 1),
+                "desc"      => $menu['descs'],
             ];
             if (!empty($menu['children'])) {
-                $menu['children'] = $this->filterMenu($menu['children'],$type,$mch);
-            }
-            if ($mch > 0) {
-                $menu['component'] = ($mch==1?'merchant/':'store/').$menu['name'];
-            } else {
-                $menu['component'] = $menu['name'];
+                $menu['children'] = $this->filterMenu($menu['children'],$type);
             }
+            $menu['component'] = $menu['name'];
             $menu['isMenu'] = $menu['status'];
             if($type == 1) unset($menu['title'],$menu['icon'],$menu['type'],$menu['pid'],$menu['id']);
         }

+ 46 - 0
app/model/cpa/CpaAccount.php

@@ -0,0 +1,46 @@
+<?php
+
+namespace app\model\cpa;
+
+use app\extra\basic\Model;
+
+
+/**
+ * @property integer $id (主键)
+ * @property mixed $advertiser_id 
+ * @property string $advertiser_name 
+ * @property integer $status 
+ * @property mixed $create_at
+ */
+class CpaAccount 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 = "cpa_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;
+
+
+}

+ 52 - 0
app/model/cpa/CpaOrder.php

@@ -0,0 +1,52 @@
+<?php
+
+namespace app\model\cpa;
+
+use app\extra\basic\Model;
+
+
+/**
+ * @property integer $id (主键)
+ * @property mixed $order_no 
+ * @property mixed $product_id 商品ID
+ * @property mixed $link_code 链接
+ * @property mixed $content 
+ * @property string $ip_addr 
+ * @property mixed $ip_province 
+ * @property mixed $ip_city 
+ * @property integer $is_callback 1已回传
+ * @property mixed $callback_at 回传时间
+ * @property mixed $create_at
+ */
+class CpaOrder 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 = "cpa_order";
+    
+    /**
+     * 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;
+
+
+}

+ 47 - 0
app/model/cpa/CpaPage.php

@@ -0,0 +1,47 @@
+<?php
+
+namespace app\model\cpa;
+
+use app\extra\basic\Model;
+
+
+/**
+ * @property integer $id (主键)
+ * @property mixed $product_id 
+ * @property mixed $link_code 
+ * @property mixed $content 
+ * @property integer $status 
+ * @property mixed $create_at
+ */
+class CpaPage 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 = "cpa_page";
+    
+    /**
+     * 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;
+
+
+}

+ 46 - 0
app/model/cpa/CpaProduct.php

@@ -0,0 +1,46 @@
+<?php
+
+namespace app\model\cpa;
+
+use app\extra\basic\Model;
+
+
+/**
+ * @property integer $id (主键)
+ * @property string $name 
+ * @property mixed $code 
+ * @property integer $status 
+ * @property mixed $create_at
+ */
+class CpaProduct 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 = "cpa_product";
+    
+    /**
+     * 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 - 3
app/service/system/MenuService.php

@@ -12,14 +12,13 @@ class MenuService extends Service
     /**
      * @param int $super
      * @param int $hide
-     * @param int $type
      * @return array
      */
-    public function getMenuList(int $super = 0,int $hide = 0,int $type = 1): array
+    public function getMenuList(int $super = 0,int $hide = 0): array
     {
         $model = new SystemMenu();
         try {
-            $data = $model->where("status",1)->where("from",$type)->order("sort","asc")->select();
+            $data = $model->where("status",1)->select();
         } catch (\Throwable $throwable) {
             return [];
         }

+ 2 - 2
config/plugin/tinywan/captcha/app.php

@@ -5,7 +5,7 @@ return [
         // 验证码存储key前缀
         'prefix'  => 'captcha',
         // 验证码字符集合
-        'codeSet'  => '0123456789',
+        'codeSet'  => '023456789',
         // 是否使用中文验证码
         'useZh'  => false,
         // 中文验证码字符串
@@ -13,7 +13,7 @@ return [
         // 是否使用背景图(不建议开启)
         'useImgBg' => false,
         // 是否使用混淆曲线
-        'useCurve' => true,
+        'useCurve' => false,
         // 是否添加杂点
         'useNoise' => true,
         // 验证码图片高度