这小子有点二 3 years ago
parent
commit
306c356391

+ 2 - 2
src/app/Api/Fruit.php

@@ -116,7 +116,7 @@ class Fruit extends BaseApi {
         //print_r($this->rebateLevel);
         $rebate = $this->rebateDomain->get();
         $userInfo = $this->userDomain->details($user_id);
-        if($userInfo['user_type'] == 0) {
+        //if($userInfo['user_type'] == 0) {
             //执行返佣
             for($i = 0; $i < $this->rebateLevel; $i++) {
                 $field = 'inviter';
@@ -140,7 +140,7 @@ class Fruit extends BaseApi {
                     'rebatePrice' => $rebatePrice
                 ));
             }
-        }
+        //}
 
         //$this->userDomain->saveActionLog($user_id, 3, $amount, $fruit_id, $fruit['fruit_name']);
         $this->userDomain->saveActionLog($user_id, 3, array(

+ 0 - 6
src/app/Api/Land.php

@@ -551,12 +551,6 @@ class Land extends BaseApi {
                 Error::send(2048);
         }
 
-        $res = $this->domain->redisLock($user_id, $land);   //判断锁
-        if (!empty($res)) {
-            Error::send(2067);
-        }
-        $this->domain->redisLock($user_id, $land, 'add');   //添加锁
-
 
         $userLandInfo = $this->domain->getLandInfo($user_id, $land);
         $user_land_id = $userLandInfo['ul_id'];

+ 4 - 0
src/app/Api/Mail.php

@@ -120,6 +120,10 @@ class Mail extends BaseApi {
             Error::send(2067);
         }
 
+        if (empty($result)) {
+            Error::send(2028);
+        }
+
         if($result['withAttachment'] == 0) {
             //邮件不存在附件
             Error::send(2028);

+ 8 - 7
src/app/Domain/Fruit.php

@@ -122,12 +122,13 @@ class Fruit {
                     //echo "=====";
                     $user_fruit_id = intval($res['uf_id']);
                     $nums = $res['uf_amount'] - $nums;
-                    if($nums <= 0) {
-                        UserFruitModel::model()->deleteAll('uf_id = ' . $user_fruit_id);
-                    }
-                    else {
-                        UserFruitModel::model()->updateAll('uf_id = ' . $user_fruit_id, array('uf_amount' => $nums));
-                    }
+                    UserFruitModel::model()->updateAll('uf_id = ' . $user_fruit_id, array('uf_amount' => $nums));
+                    // if($nums <= 0) {
+                    //     UserFruitModel::model()->deleteAll('uf_id = ' . $user_fruit_id);
+                    // }
+                    // else {
+                        
+                    // }
                     break;
                 }
             }
@@ -163,7 +164,7 @@ class Fruit {
      * @return mixed
      */
     public function getUserFruitListTotal($user_id) {
-        $where = 'uf_user_id = :user_id';
+        $where = 'uf_user_id = :user_id and uf_amount > 0';
         $whereParams = array(
             ':user_id' => $user_id
         );

+ 3 - 3
src/app/Domain/Mail.php

@@ -19,7 +19,7 @@ class Mail {
      * @return array
      */
     public function getInfo($maiL_id) {
-        $where = "mail_id = :mail_id";
+        $where = "mail_id = :mail_id and deletetime is null";
         $whereParams = array(
             ':mail_id' => $maiL_id
         );
@@ -40,7 +40,7 @@ class Mail {
         $user_info = $UserDomain->getUserInfoField($user_id, 'user_reg_time');
         $user_reg_time = 0;
         if ($user_info) $user_reg_time = $user_info['user_reg_time'];
-        $where = "(mail_sender like :user_id OR mail_sender = '0') and mail_send_time > :user_reg_time ";
+        $where = "(mail_sender like :user_id OR mail_sender = '0') and mail_send_time > :user_reg_time and deletetime is null";
         $whereParams = array(
             ':user_id' => '%' . $user_id . '%',
             ':user_reg_time' => $user_reg_time,
@@ -61,7 +61,7 @@ class Mail {
         $user_info = $UserDomain->getUserInfoField($user_id, 'user_reg_time');
         $user_reg_time = 0;
         if ($user_info) $user_reg_time = $user_info['user_reg_time'];
-        $where = "mail_sender like :user_id OR mail_sender = '0' and mail_send_time > :user_reg_time";
+        $where = "mail_sender like :user_id OR mail_sender = '0' and mail_send_time > :user_reg_time and deletetime is null";
         $whereParams = array(
             ':user_id' => '%' . $user_id . '%',
             ':user_reg_time' => $user_reg_time,

+ 21 - 0
src/app/Domain/Notice.php

@@ -49,6 +49,10 @@ class Notice {
      * @return void
      */
     public function setIsRead($nl_user_id, $nl_notice_id) {
+        NoticeListModel::model()->getDataBy('nl_notice_id', $nl_notice_id);
+        if ($this->getNoticeCount($nl_user_id, $nl_notice_id)>0) {
+            return;
+        }
         $data = array(
             'nl_notice_id'  => $nl_notice_id,
             'nl_user_id'    => $nl_user_id,
@@ -57,4 +61,21 @@ class Notice {
         );
         NoticeListModel::model()->insert($data);
     }
+
+    /**
+     * 获取公告是否已读统计
+     * @param $user_id
+     * @return mixed
+     */
+    public function getNoticeCount($nl_user_id, $nl_notice_id) {
+        $where = 'nl_user_id = :nl_user_id and nl_notice_id = :nl_notice_id';
+        $whereParams = array(
+            ':nl_user_id' => $nl_user_id,
+            ':nl_notice_id' => $nl_notice_id
+        );
+        $select = 'COUNT(1) as total';
+        $result = NoticeListModel::model()->getData($where, $whereParams, $select);
+        return $result['total'];
+    }
+
 }

+ 1 - 1
src/app/Domain/Props.php

@@ -18,7 +18,7 @@ class Props {
      * @return array
      */
     public function getUserPropsList($user_id) {
-        $sql = "SELECT b.props_name as name, b.props_img_url as img_url, b.props_desc as intro, b.props_type as type, a.up_id as user_props_id, a.up_amount as amount FROM user_props as a Left Join props as b On a.up_props_id = b.props_id WHERE a.up_user_id = '$user_id'";
+        $sql = "SELECT b.props_name as name, b.props_img_url as img_url, b.props_desc as intro, b.props_type as type, a.up_id as user_props_id, a.up_amount as amount FROM user_props as a Left Join props as b On a.up_props_id = b.props_id WHERE a.up_user_id = '$user_id' and a.up_amount > 0";
         return UserPropsModel::model()->queryAll($sql);
     }
 

+ 1 - 1
src/app/Domain/Seed.php

@@ -63,7 +63,7 @@ class Seed {
      * @return array
      */
     function getUserSeedList($user_id) {
-        $sql = "SELECT c.shop_id as shop_id, b.seed_name as name, c.shop_img_url as img_url, b.seed_id as seed_id, a.us_id as user_seed_id, a.us_seed_id as seed_id, a.us_amount as amount FROM user_seed as a Left Join seed AS b ON a.us_seed_id = b.seed_id Left Join shop AS c ON a.us_seed_id = c.shop_seed_id WHERE a.us_user_id = '$user_id'";
+        $sql = "SELECT c.shop_id as shop_id, b.seed_name as name, c.shop_img_url as img_url, b.seed_id as seed_id, a.us_id as user_seed_id, a.us_seed_id as seed_id, a.us_amount as amount FROM user_seed as a Left Join seed AS b ON a.us_seed_id = b.seed_id Left Join shop AS c ON a.us_seed_id = c.shop_seed_id WHERE a.us_user_id = '$user_id'  and a.us_amount > 0";
         return UserSeedModel::model()->queryAll($sql);
     }
 

+ 1 - 0
src/app/Model/UserFruitNotORM.php

@@ -24,6 +24,7 @@ class UserFruitNotORM extends NotORM {
             ->alias('a')
             ->leftJoin('fruit', 'b', 'a.uf_fruit_id = b.fruit_id')
             ->where('a.uf_user_id', $user_id)
+            ->where('a.uf_amount > 0')
             ->page($page, $size)
             ->fetchAll();
     }