作者 李宇航

合并分支 'lyh-server' 到 'master'

变更数据



查看合并请求 !3185
@@ -40,7 +40,7 @@ class GeoConfirmLogic extends BaseLogic @@ -40,7 +40,7 @@ class GeoConfirmLogic extends BaseLogic
40 public function saveConfirmContent($param) 40 public function saveConfirmContent($param)
41 { 41 {
42 try { 42 try {
43 - $wechat = $param['wechat']; 43 + $wechat = $param['wechat'] ?? true;
44 unset($param['wechat']); 44 unset($param['wechat']);
45 $info = $this->model->read(['project_id' => $param['project_id'],'type' => $param['type']]); 45 $info = $this->model->read(['project_id' => $param['project_id'],'type' => $param['type']]);
46 if($info === false){ 46 if($info === false){
@@ -102,8 +102,9 @@ class GeoWritingsLogic extends BaseLogic @@ -102,8 +102,9 @@ class GeoWritingsLogic extends BaseLogic
102 */ 102 */
103 public function sendWechatMessage() 103 public function sendWechatMessage()
104 { 104 {
  105 + $wechat = $this->param['wechat'] ?? true;
105 $this->model->edit(['status'=>2],['status'=>1,'project_id'=>$this->param['project_id']]); 106 $this->model->edit(['status'=>2],['status'=>1,'project_id'=>$this->param['project_id']]);
106 - $data = GeoWritings::sendConfirmMessage($this->param['project_id']); 107 + $data = GeoWritings::sendConfirmMessage($this->param['project_id'],$wechat);
107 if($data === false){ 108 if($data === false){
108 $this->fail('项目未绑定微信群'); 109 $this->fail('项目未绑定微信群');
109 } 110 }
@@ -77,7 +77,7 @@ class GeoWritings extends Base @@ -77,7 +77,7 @@ class GeoWritings extends Base
77 * @return bool 77 * @return bool
78 * @throws \Exception 78 * @throws \Exception
79 */ 79 */
80 - public static function sendConfirmMessage($project_id) 80 + public static function sendConfirmMessage($project_id,$wechat = true)
81 { 81 {
82 $friend = ProjectAssociation::where(['project_id' => $project_id])->first(); 82 $friend = ProjectAssociation::where(['project_id' => $project_id])->first();
83 if (empty($friend)) { 83 if (empty($friend)) {
@@ -104,9 +104,11 @@ class GeoWritings extends Base @@ -104,9 +104,11 @@ class GeoWritings extends Base
104 'thumbUrl' => 'https://hub.globalso.com/logocm.png', 104 'thumbUrl' => 'https://hub.globalso.com/logocm.png',
105 'url' => 'https://oa.quanqiusou.cn/public-geo-article-list?token=' . $token 105 'url' => 'https://oa.quanqiusou.cn/public-geo-article-list?token=' . $token
106 ]; 106 ];
107 - $content = json_encode($content_array, JSON_UNESCAPED_UNICODE);  
108 - MessagePush::insert(compact('project_id', 'friend_id', 'type', 'content_type', 'content', 'send_time', 'updated_at', 'created_at'));  
109 - return true; 107 + if($wechat){
  108 + $content = json_encode($content_array, JSON_UNESCAPED_UNICODE);
  109 + MessagePush::insert(compact('project_id', 'friend_id', 'type', 'content_type', 'content', 'send_time', 'updated_at', 'created_at'));
  110 + }
  111 + return $content_array;
110 } 112 }
111 113
112 } 114 }