dever 3 năm trước cách đây
mục cha
commit
777fa39f4b

+ 16 - 0
service/option/database/account.php

@@ -29,6 +29,12 @@ $is_email = array
     2 => '邮箱未验证',
 );
 
+$send_email = array
+(
+    1 => '不发送邮件',
+    2 => '发送邮件',
+);
+
 $is_idcard = array
 (
     1 => '已上传',
@@ -140,6 +146,16 @@ return array
             'list_order' => 3,
         ),
 
+        'send_email'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '是否发送邮件',
+            'default'   => '2',
+            'desc'      => '是否发送邮件',
+            'match'     => 'is_numeric',
+            'option'    => $send_email,
+        ),
+
         'email'     => array
         (
             'type'      => 'varchar-150',

+ 11 - 4
service/option/lib/Account.php

@@ -200,16 +200,23 @@ class Account
         $button[0]['btn'][] = array
         (
             'type' => 'edit',
-            'link' => Dever::url('project/database/update?project=option&table=member&where_id='.$account['mid'].'&status=1&col=name,idcard', 'manage'),
+            'link' => Dever::url('project/database/update?project=option&table=member&where_id='.$mid.'&status=1&col=name,idcard', 'manage'),
             'name' => '修改资料',
         );
 
+        $button[0]['btn'][] = array
+        (
+            'type' => 'edit',
+            'link' => Dever::url('project/database/update?project=option&table=account&where_id='.$aid.'&status=1&col=email', 'manage'),
+            'name' => '修改邮箱',
+        );
+
         $url = '';
         if ($account['audit'] == 2) {
             $button[0]['btn'][] = array
             (
                 'type' => 'edit',
-                'link' => Dever::url('project/database/update?project=option&table=account&where_id='.$account['id'].'&status=1&col=audit,audit_desc', 'manage'),
+                'link' => Dever::url('project/database/update?project=option&table=account&where_id='.$aid.'&status=1&col=audit,audit_desc', 'manage'),
                 'name' => '审核',
             );
         }
@@ -218,14 +225,14 @@ class Account
             $button[0]['btn'][] = array
             (
                 'type' => 'action',
-                'link' => Dever::url('lib/account.setStatus?id=' . $account['id'] . '&value=2', 'option'),
+                'link' => Dever::url('lib/account.setStatus?id=' . $aid . '&value=2', 'option'),
                 'name' => '恢复账号',
             );
         } elseif ($account['status'] == 2) {
             $button[0]['btn'][] = array
             (
                 'type' => 'action',
-                'link' => Dever::url('lib/account.setStatus?id=' . $account['id'] . '&value=3', 'option'),
+                'link' => Dever::url('lib/account.setStatus?id=' . $aid . '&value=3', 'option'),
                 'name' => '禁用账号',
             );
         }

+ 1 - 1
service/option/lib/Core.php

@@ -14,7 +14,7 @@ class Core
     {
         $this->uid = Dever::load('passport/user')->check(false);
         if ($this->uid <= 0) {
-            $this->uid = 2;
+            $this->uid = 1;
         }
         $this->checkLogin();
         if ($this->uid) {

+ 22 - 4
service/option/lib/Manage.php

@@ -40,11 +40,29 @@ class Manage
         Dever::config('base')->hook = true;
         $update = array();
         $audit = Dever::param('audit', $data);
+        $send_email = Dever::param('send_email', $data);
+        $email = Dever::param('email', $data);
         $info = Dever::db('option/account')->one($id);
-        if ($audit > 2 && $info) {
-            $update['audit_date'] = time();
-            $update['where_id'] = $info['id'];
-            Dever::db('option/account')->update($update);
+        if ($info) {
+            if ($audit && $audit > 2) {
+                $update['audit_date'] = time();
+                $update['where_id'] = $info['id'];
+                Dever::db('option/account')->update($update);
+            }
+            if ($send_email == 2 && $email && $email != $info['email']) {
+                $update = array();
+                $update['is_email'] = 2;
+                $update['where_id'] = $info['id'];
+                Dever::db('option/account')->update($update);
+                if ($send_email == 2) {
+                    $member = Dever::db('option/account')->one($info['mid']);
+                    if ($member) {
+                        $code = Dever::load('passport/reg')->code(false, false);
+                        $email = base64_encode($email);
+                        Dever::daemon('lib/email.renzheng?aid='.$this->uid.'&email=' . $email . '&code=' . $code . '&username=' . $member['name'], 'option');
+                    }   
+                }
+            }
         }
     }
 

+ 2 - 2
service/option/src/My.php

@@ -11,8 +11,8 @@ class My extends Core
     {
         $where['email'] = '2934170@qq.com';
         $code = Dever::load('passport/reg')->code(false, false);
-            $email = base64_encode($where['email']);
-            Dever::daemon('lib/email.renzheng?aid='.$this->uid.'&email=' . $email . '&code=' . $code . '&username=' . $this->user['name'], 'option');
+        $email = base64_encode($where['email']);
+        Dever::daemon('lib/email.renzheng?aid='.$this->uid.'&email=' . $email . '&code=' . $code . '&username=' . $this->user['name'], 'option');
     }
 
     /**