作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

@@ -90,7 +90,10 @@ class GeoWritingsLogic extends BaseLogic @@ -90,7 +90,10 @@ class GeoWritingsLogic extends BaseLogic
90 public function sendWechatMessage() 90 public function sendWechatMessage()
91 { 91 {
92 $this->model->edit(['status'=>2],['status'=>1,'project_id'=>$this->param['project_id']]); 92 $this->model->edit(['status'=>2],['status'=>1,'project_id'=>$this->param['project_id']]);
93 - GeoWritings::sendConfirmMessage($this->param['project_id']);  
94 - return $this->success(); 93 + $data = GeoWritings::sendConfirmMessage($this->param['project_id']);
  94 + if($data === false){
  95 + $this->fail('项目未绑定微信群');
  96 + }
  97 + return $this->success($data);
95 } 98 }
96 } 99 }
@@ -77,20 +77,21 @@ class GeoWritings extends Base @@ -77,20 +77,21 @@ class GeoWritings extends Base
77 */ 77 */
78 public static function sendConfirmMessage($project_id) 78 public static function sendConfirmMessage($project_id)
79 { 79 {
80 - $friend = ProjectAssociation::where(['project_id' => $project_id])->first();  
81 - if (empty($friend)) {  
82 - throw new \Exception('项目未绑定微信群');  
83 - } 80 +// $friend = ProjectAssociation::where(['project_id' => $project_id])->first();
  81 +// if (empty($friend)) {
  82 +// return false;
  83 +// }
84 $content_type = 'Link'; 84 $content_type = 'Link';
85 $send_time = now(); 85 $send_time = now();
86 $type = MessagePush::TYPE_GEO_CONFIRM; 86 $type = MessagePush::TYPE_GEO_CONFIRM;
87 - $friend_id = $friend->friend_id; 87 +// $friend_id = $friend->friend_id;
88 $created_at = $updated_at = now(); 88 $created_at = $updated_at = now();
89 $param = [ 89 $param = [
90 'project_id' => $project_id, 90 'project_id' => $project_id,
91 'send_at' => time() 91 'send_at' => time()
92 ]; 92 ];
93 $token = Crypt::encrypt($param); 93 $token = Crypt::encrypt($param);
  94 + return ['token'=>$token];
94 $content_array = [ 95 $content_array = [
95 'title' => "确认核心文章", 96 'title' => "确认核心文章",
96 'desc' => '确认核心文章', 97 'desc' => '确认核心文章',