xxxrrrdddd 3 年之前
父节点
当前提交
db067aff8f
共有 2 个文件被更改,包括 11 次插入0 次删除
  1. 10 0
      application/common/model/Mobile.php
  2. 1 0
      application/common/model/MobileOrder.php

+ 10 - 0
application/common/model/Mobile.php

@@ -142,4 +142,14 @@ class Mobile extends Model
         $model->where('status','<>',2);
         return $model;
     }
+
+    /**
+     *@param self $mobile
+     */
+    public static function whenOrderPayed($mobile){
+        if($mobile){
+            $mobile['status']=1;
+            $mobile->save();
+        }
+    }
 }

+ 1 - 0
application/common/model/MobileOrder.php

@@ -53,6 +53,7 @@ class MobileOrder extends Model
             #已支付
             if(isset($data['status']) && $data['status']==self::STATUS_WAIT_SEND){
                 SysConfig::set('mo_ordered_num',SysConfig::look('mo_ordered_num',0)+1);
+                Mobile::whenOrderPayed($mobileOrder->mobile);
             }
         });
     }