dever 6 years ago
parent
commit
4064e4af00
2 changed files with 7 additions and 8 deletions
  1. 2 2
      lib/Data.php
  2. 5 6
      lib/Push.php

+ 2 - 2
lib/Data.php

@@ -121,7 +121,7 @@ class Data
         $content = Dever::input('content', 'test');
         $content = Dever::input('content', 'test');
         $result = $this->push($uid, $to_uid, $name, $content, 11, 1, 1, $push);
         $result = $this->push($uid, $to_uid, $name, $content, 11, 1, 1, $push);
 
 
-        return 'ok';
+        return $result;
     }
     }
 
 
 	/**
 	/**
@@ -199,7 +199,7 @@ class Data
                         # 发送全部
                         # 发送全部
                         $to_uid = array();
                         $to_uid = array();
                     }
                     }
-                    Dever::load('message/lib/push')->send($config['push'], $to_uid, $name, $content, $push);
+                    return Dever::load('message/lib/push')->send($config['push'], $to_uid, $name, $content, $push);
                     //Dever::daemon('lib/push.send?', 'message');
                     //Dever::daemon('lib/push.send?', 'message');
                 }
                 }
             }
             }

+ 5 - 6
lib/Push.php

@@ -59,12 +59,11 @@ class Push
 			$send[] = \XingeApp::IOSENV_DEV;
 			$send[] = \XingeApp::IOSENV_DEV;
 		}
 		}
 
 
-		$result[$source_type] = call_user_func_array(array($push, $method), $send);
+		$result[$source_type]['send'] = $send;
+		$result[$source_type]['message'] = array($name, $content, $param);
+		$result[$source_type]['result'] = call_user_func_array(array($push, $method), $send);
 
 
-		$log['result'] = $result;
-		$log['send'] = $send;
-		$log['message'] = array($name, $content, $param);
-		$log = Dever::json_encode($log);
+		$log = Dever::json_encode($result[$source_type]);
 		Dever::log($log, 'message_app_push');
 		Dever::log($log, 'message_app_push');
 
 
 		return $result;
 		return $result;
@@ -112,7 +111,7 @@ class Push
    	{
    	{
    		$result = array();
    		$result = array();
    		$info = Dever::db('passport/app')->one(array('uid' => $account));
    		$info = Dever::db('passport/app')->one(array('uid' => $account));
-   		//$info['source_type'] = 'ios';
+   		$info['source_type'] = 'ios';
    		if ($info && $info['source_type']) {
    		if ($info && $info['source_type']) {
    			$result = $this->sendAction($info['source_type'], 2, $this->prefix . $account, $name, $content, $param);
    			$result = $this->sendAction($info['source_type'], 2, $this->prefix . $account, $name, $content, $param);
    		}
    		}