作者 刘锟

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

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