Your Name 2 years ago
parent
commit
913eb0cec9
3 changed files with 45 additions and 4 deletions
  1. 41 0
      learn/active/lib/Coreoff.php
  2. 3 3
      learn/active/src/Off.php
  3. 1 1
      service/agent/lib/Option_account.php

+ 41 - 0
learn/active/lib/Coreoff.php

@@ -0,0 +1,41 @@
+<?php
+
+namespace Active\Lib;
+
+use Dever;
+
+Class Coreoff
+{
+    protected $uid = -1;
+    protected $use = array();
+    protected $check = true;
+    public $data = array();
+
+    public function __construct()
+    {
+        $this->uid = Dever::load('passport/user')->check(false);
+        if ($this->uid <= 0) {
+            // $this->uid = 1;
+        }
+        if ($this->check) {
+            $this->checkLogin();
+        }
+        
+        if ($this->uid) {
+            $this->user = Dever::db('active/info_off')->find($this->uid);
+            // $this->user['uid'] = $this->user['id'];
+        }
+        if ($this->check) {
+            if ($this->user) {
+                $this->user['uid'] = $this->user['id'];
+            } 
+        }
+    }
+
+    public function checkLogin()
+    {
+        if (!$this->uid || $this->uid <= 0) {
+            Dever::alert('请先登录', -2);
+        }
+    }
+}

+ 3 - 3
learn/active/src/Off.php

@@ -2,9 +2,9 @@
 namespace Active\Src;
 
 use Dever;
-use Active\Lib\Offcore;
+use Active\Lib\Coreoff;
 
-Class Off extends Offcore
+Class Off extends Coreoff
 {
 	#核销首页
 	public function getHome()
@@ -17,7 +17,7 @@ Class Off extends Offcore
 		}
 		return $data;
 	}
-	
+
 	#核销列表信息
 	public function getList(){
 		$code = Dever::input('code');

+ 1 - 1
service/agent/lib/Option_account.php

@@ -260,7 +260,7 @@ Class Option_account{
 		$info = Dever::db('agent/option_account')->find($id);
 		if (!$info) {
 			if ($price <= $zh_price){
-				$zj_price = $zh_price;
+				$zj_price = $price;
 			} elseif ($price > $zh_price) {
 				$zj_price = $price - $zh_price;
 			}