Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

李洋 / 消息系统

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Find file
Normal viewHistoryPermalink
Switch branch/tag
  • CMS-Message
  • app
  • Http
  • Controllers
  • MessageApiController.php
MessageApiController.php 16 KB
李洋's avatar
添加修改数据库api
d624e727
 
李洋 committed 7 years ago
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<?php
/**
 * Created by PhpStorm.
 * User: leo
 * Date: 2017/12/7
 * Time: 13:04
 */

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Requests;
use DB;
use RedisDB;
李洋's avatar
fix bug
e9771a85
 
李洋 committed 7 years ago
15
use Config;
李洋's avatar
添加修改数据库api
d624e727
 
李洋 committed 7 years ago
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32

class MessageApiController extends Controller
{
    public function Entrance(Request $request, $id ){
        //统一入口
        $this->$id($request, $id);
    }

    private function Export($errcode=0,$errmsg='成功',$data=''){
        echo json_encode(['errcode'=>$errcode,'errmsg'=>$errmsg,'data'=>$data]);
        exit();
    }

    //新增/编辑 消息模板
    private function addTemplate($request)
    {
        $data = $request->input();
李洋's avatar
1111
964b032b
 
李洋 committed 7 years ago
33
//        var_dump($data);die;
李洋's avatar
1、添加重复的 模板描述 错误提示
253536a8
 
李洋 committed 7 years ago
34

李洋's avatar
update api
fc0928a2
 
李洋 committed 7 years ago
35
        $insert_tpl_id = $data['tpl_id'];
李洋's avatar
修复更新模板问题
ff1bf2cd
 
李洋 committed 7 years ago
36

李洋's avatar
添加修改数据库api
d624e727
 
李洋 committed 7 years ago
37
        //至少选择一个渠道
李洋's avatar
修复更新模板问题
ff1bf2cd
 
李洋 committed 7 years ago
38 39
        if (empty($data['channels'])) {
            $this->Export(11001, '请勾选至少一个消息渠道');
李洋's avatar
update api
fc0928a2
 
李洋 committed 7 years ago
40
        }
李洋's avatar
修复更新模板问题
ff1bf2cd
 
李洋 committed 7 years ago
41 42
        if (empty($data['description'])) {
            $this->Export(11002, '请输入模板描述');
李洋's avatar
update api
fc0928a2
 
李洋 committed 7 years ago
43
        }
李洋's avatar
fix bug
e9771a85
 
李洋 committed 7 years ago
44

李洋's avatar
1、添加重复的 模板描述 错误提示
253536a8
 
李洋 committed 7 years ago
45
        $is_dumplicated = DB::connection('message')->table('lie_msg_tpl')->where('description',$data['description'])->first();
李洋's avatar
fix bug
e9771a85
 
李洋 committed 7 years ago
46 47 48 49 50 51 52
        if(empty($insert_tpl_id))
        {
            if($is_dumplicated !== NULL)
            {
                $this->Export(11022, '已存在相同模板描述,请更换描述内容');
            }
        }else
李洋's avatar
1、添加重复的 模板描述 错误提示
253536a8
 
李洋 committed 7 years ago
53
        {
李洋's avatar
fix bug
e9771a85
 
李洋 committed 7 years ago
54 55 56 57 58
            $is_edit_dumplicated = DB::connection('message')->table('lie_msg_tpl')->where('description',$data['description'])->whereNotIn('tpl_id',[$insert_tpl_id])->first();
            if($is_edit_dumplicated !== NULL)
            {
                $this->Export(11023, '已存在相同模板描述,请更换描述内容');
            }
李洋's avatar
1、添加重复的 模板描述 错误提示
253536a8
 
李洋 committed 7 years ago
59
        }
李洋's avatar
update api
fc0928a2
 
李洋 committed 7 years ago
60

李洋's avatar
fix bug
e9771a85
 
李洋 committed 7 years ago
61

李洋's avatar
添加事务 保证 数据库多条修改时 原子操作
294256d2
 
李洋 committed 7 years ago
62
        //添加事务 保证 数据库多条修改时 原子操作
李洋's avatar
1111
964b032b
 
李洋 committed 7 years ago
63
        DB::connection('message')->transaction(function() use($data) {
李洋's avatar
添加事务 保证 数据库多条修改时 原子操作
294256d2
 
李洋 committed 7 years ago
64 65 66 67 68 69 70
            //消息模板模型
            $tpl_model = [];
            $tpl_model['tpl_id'] = $data['tpl_id'];
            $tpl_model['channels'] = $data['channels'];
            $tpl_model['description'] = $data['description'];
            $tpl_model['source_type'] = $data['source_type'];
            $tpl_model['creater'] = $data['creater'];
李洋's avatar
1111
964b032b
 
李洋 committed 7 years ago
71
            $tpl_model['obj_user'] = $data['obj_user'];
李洋's avatar
添加事务 保证 数据库多条修改时 原子操作
294256d2
 
李洋 committed 7 years ago
72
            $tpl_model['msg_type'] = $data['msg_type'];
李洋's avatar
111
771db551
 
李洋 committed 7 years ago
73

李洋's avatar
添加事务 保证 数据库多条修改时 原子操作
294256d2
 
李洋 committed 7 years ago
74 75 76 77
            if (empty($tpl_model['tpl_id'])) {
                $tpl_model['create_time'] = time();
                $tpl_model['update_time'] = time();
                $insert_tpl_id = DB::connection('message')->table('lie_msg_tpl')->insertGetId($tpl_model);
李洋's avatar
1111
964b032b
 
李洋 committed 7 years ago
78
//                var_dump($insert_tpl_id);die;
李洋's avatar
添加事务 保证 数据库多条修改时 原子操作
294256d2
 
李洋 committed 7 years ago
79 80
                if (!$insert_tpl_id) {
                    $this->Export(11020, '新增消息模板失败');
李洋's avatar
update api
fc0928a2
 
李洋 committed 7 years ago
81
                }
李洋's avatar
修复更新模板问题
ff1bf2cd
 
李洋 committed 7 years ago
82
            } else {
李洋's avatar
添加事务 保证 数据库多条修改时 原子操作
294256d2
 
李洋 committed 7 years ago
83 84 85
                $tpl_model['update_time'] = time();
                $result = DB::connection('message')->table('lie_msg_tpl')->where('tpl_id', $tpl_model['tpl_id'])->update($tpl_model);
                $insert_tpl_id = $tpl_model['tpl_id'];
李洋's avatar
修复更新模板问题
ff1bf2cd
 
李洋 committed 7 years ago
86
                if (!$result) {
李洋's avatar
添加事务 保证 数据库多条修改时 原子操作
294256d2
 
李洋 committed 7 years ago
87
                    $this->Export(11021, '编辑消息模板失败');
李洋's avatar
添加修改数据库api
d624e727
 
李洋 committed 7 years ago
88 89
                }
            }
李洋's avatar
添加事务 保证 数据库多条修改时 原子操作
294256d2
 
李洋 committed 7 years ago
90 91 92 93 94 95

            //每一个渠道模板 的验证与写数据库
            //选了站内信渠道 就要选站内信类型
            if (strpos($data['channels'], '1') !== false) {
                if (empty($data['msg_type'])) {
                    $this->Export(11003, '请选择站内信类型');
李洋's avatar
update api
fc0928a2
 
李洋 committed 7 years ago
96
                }
李洋's avatar
添加事务 保证 数据库多条修改时 原子操作
294256d2
 
李洋 committed 7 years ago
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
                if (empty($data['inner_title'])) {
                    $this->Export(11004, '请填写站内信标题');
                }
                if (empty($data['inner_content'])) {
                    $this->Export(11005, '请填写站内信内容');
                }
                if (empty($data['op_type'])) {
                    $this->Export(11006, '请选择点击消息操作');
                }
                if (empty($data['url']) && $data['op_type'] == 2) {
                    $this->Export(11007, '请填写要打开的url');
                }
                $chn_tpl_model_inner = [];
                $chn_tpl_model_inner['channel_tpl_id'] = $data['inner_channel_tpl_id'];
                $chn_tpl_model_inner['channel_type'] = $data['inner_channel_type'];
                $chn_tpl_model_inner['title'] = $data['inner_title'];
                $chn_tpl_model_inner['content'] = $data['inner_content'];
                $chn_tpl_model_inner['op_type'] = $data['op_type'];
                $chn_tpl_model_inner['tpl_id'] = $insert_tpl_id;
                if ($data['op_type'] == 2) {
                    $chn_tpl_model_inner['url'] = $data['url'];
                }
                if (empty($chn_tpl_model_inner['channel_tpl_id'])) {
                    $chn_tpl_model_inner['create_time'] = time();
                    $chn_tpl_model_inner['update_time'] = time();
                    $result = DB::connection('message')->table('lie_msg_channel_tpl')->insert($chn_tpl_model_inner);
                    if (!$result) {
                        $this->Export(11008, '新增消息模板失败');
                    }
                } else {
                    $chn_tpl_model_inner['update_time'] = time();
                    $result = DB::connection('message')->table('lie_msg_channel_tpl')->where('channel_tpl_id', $chn_tpl_model_inner['channel_tpl_id'])->update($chn_tpl_model_inner);
                    if (!$result) {
                        $this->Export(11009, '编辑消息模板失败');
                    }
李洋's avatar
update api
fc0928a2
 
李洋 committed 7 years ago
132
                }
李洋's avatar
1111
964b032b
 
李洋 committed 7 years ago
133 134 135 136
            } else {
                if (!empty($data['inner_channel_tpl_id'])) {
                    $delete_result = DB::connection('message')->table('lie_msg_channel_tpl')->where('channel_tpl_id', $data['inner_channel_tpl_id'])->delete();
                    if (!$delete_result) {
李洋's avatar
1、删除不勾选的模板渠道
b151a00e
 
李洋 committed 7 years ago
137 138 139
                        $this->Export(11009, '编辑消息模板失败');
                    }
                }
李洋's avatar
update api
fc0928a2
 
李洋 committed 7 years ago
140
            }
李洋's avatar
添加事务 保证 数据库多条修改时 原子操作
294256d2
 
李洋 committed 7 years ago
141 142 143
            if (strpos($data['channels'], '2') !== false) {
                if (empty($data['sms_content'])) {
                    $this->Export(11010, '请填写短信内容');
李洋's avatar
update api
fc0928a2
 
李洋 committed 7 years ago
144
                }
李洋's avatar
添加事务 保证 数据库多条修改时 原子操作
294256d2
 
李洋 committed 7 years ago
145 146 147
                $chn_tpl_model_sms = [];
                $chn_tpl_model_sms['channel_tpl_id'] = $data['sms_channel_tpl_id'];
                $chn_tpl_model_sms['channel_type'] = $data['sms_channel_type'];
李洋's avatar
111
771db551
 
李洋 committed 7 years ago
148

李洋's avatar
添加事务 保证 数据库多条修改时 原子操作
294256d2
 
李洋 committed 7 years ago
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
                $chn_tpl_model_sms['content'] = $data['sms_content'];
                $chn_tpl_model_sms['tpl_id'] = $insert_tpl_id;
                if (empty($chn_tpl_model_sms['channel_tpl_id'])) {
                    $chn_tpl_model_sms['create_time'] = time();
                    $chn_tpl_model_sms['update_time'] = time();
                    $result = DB::connection('message')->table('lie_msg_channel_tpl')->insert($chn_tpl_model_sms);
                    if (!$result) {
                        $this->Export(11011, '新增消息模板失败');
                    }
                } else {
                    $chn_tpl_model_sms['update_time'] = time();
                    $result = DB::connection('message')->table('lie_msg_channel_tpl')->where('channel_tpl_id', $chn_tpl_model_sms['channel_tpl_id'])->update($chn_tpl_model_sms);
                    if (!$result) {
                        $this->Export(11012, '编辑消息模板失败');
                    }
李洋's avatar
update api
fc0928a2
 
李洋 committed 7 years ago
164
                }
李洋's avatar
1111
964b032b
 
李洋 committed 7 years ago
165 166 167 168
            } else {
                if (!empty($data['sms_channel_tpl_id'])) {
                    $delete_result = DB::connection('message')->table('lie_msg_channel_tpl')->where('channel_tpl_id', $data['sms_channel_tpl_id'])->delete();
                    if (!$delete_result) {
李洋's avatar
1、删除不勾选的模板渠道
b151a00e
 
李洋 committed 7 years ago
169 170 171
                        $this->Export(11012, '编辑消息模板失败');
                    }
                }
李洋's avatar
update api
fc0928a2
 
李洋 committed 7 years ago
172
            }
李洋's avatar
添加事务 保证 数据库多条修改时 原子操作
294256d2
 
李洋 committed 7 years ago
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199
            if (strpos($data['channels'], '3') !== false) {
                if (empty($data['email_title'])) {
                    $this->Export(11013, '请填写邮件标题');
                }
                if (empty($data['email_content'])) {
                    $this->Export(11014, '请填写邮件内容');
                }
                $chn_tpl_model_email = [];
                $chn_tpl_model_email['channel_tpl_id'] = $data['email_channel_tpl_id'];
                $chn_tpl_model_email['channel_type'] = $data['email_channel_type'];
                $chn_tpl_model_email['title'] = $data['email_title'];
                $chn_tpl_model_email['content'] = $data['email_content'];
                $chn_tpl_model_email['tpl_id'] = $insert_tpl_id;
                if (empty($chn_tpl_model_email['channel_tpl_id'])) {
                    $chn_tpl_model_email['create_time'] = time();
                    $chn_tpl_model_email['update_time'] = time();
                    $result = DB::connection('message')->table('lie_msg_channel_tpl')->insert($chn_tpl_model_email);
                    if (!$result) {
                        $this->Export(11015, '新增消息模板失败');
                    }
                } else {
                    $chn_tpl_model_email['update_time'] = time();
                    $result = DB::connection('message')->table('lie_msg_channel_tpl')->where('channel_tpl_id', $chn_tpl_model_email['channel_tpl_id'])->update($chn_tpl_model_email);
                    if (!$result) {
                        $this->Export(11016, '编辑消息模板失败', $result);
                    }
                }
李洋's avatar
1111
964b032b
 
李洋 committed 7 years ago
200 201 202 203
            } else {
                if (!empty($data['email_channel_tpl_id'])) {
                    $delete_result = DB::connection('message')->table('lie_msg_channel_tpl')->where('channel_tpl_id', $data['email_channel_tpl_id'])->delete();
                    if (!$delete_result) {
李洋's avatar
1、删除不勾选的模板渠道
b151a00e
 
李洋 committed 7 years ago
204 205 206
                        $this->Export(11016, '编辑消息模板失败');
                    }
                }
李洋's avatar
update api
fc0928a2
 
李洋 committed 7 years ago
207
            }
李洋's avatar
添加事务 保证 数据库多条修改时 原子操作
294256d2
 
李洋 committed 7 years ago
208 209 210
            if (strpos($data['channels'], '4') !== false) {
                if (empty($data['wechat_notify_title'])) {
                    $this->Export(11017, '请填写微信模板编号');
李洋's avatar
update api
fc0928a2
 
李洋 committed 7 years ago
211
                }
李洋's avatar
添加事务 保证 数据库多条修改时 原子操作
294256d2
 
李洋 committed 7 years ago
212 213 214 215 216
                $chn_tpl_model_wechatnotify = [];
                $chn_tpl_model_wechatnotify['channel_tpl_id'] = $data['wechat_notify_tpl_id'];
                $chn_tpl_model_wechatnotify['channel_type'] = $data['wechat_notify_channel_type'];
                $chn_tpl_model_wechatnotify['title'] = $data['wechat_notify_title'];
                $chn_tpl_model_wechatnotify['tpl_id'] = $insert_tpl_id;
李洋's avatar
微信
86ebc545
 
李洋 committed 7 years ago
217 218 219
                $chn_tpl_model_wechatnotify['url'] = $data['wechat_notify_url'];
                $wechat_head = $data['wechat_notify_head'];
                $wechat_tail = $data['wechat_notify_tail'];
李洋's avatar
1111
964b032b
 
李洋 committed 7 years ago
220
                $wechat_content = json_encode(array('wechat_tpl_head' => $wechat_head, 'wechat_tpl_tail' => $wechat_tail));
李洋's avatar
微信
86ebc545
 
李洋 committed 7 years ago
221
                $chn_tpl_model_wechatnotify['content'] = $wechat_content;
李洋's avatar
添加事务 保证 数据库多条修改时 原子操作
294256d2
 
李洋 committed 7 years ago
222 223 224 225 226 227 228 229 230 231 232 233 234
                if (empty($chn_tpl_model_wechatnotify['channel_tpl_id'])) {
                    $chn_tpl_model_wechatnotify['create_time'] = time();
                    $chn_tpl_model_wechatnotify['update_time'] = time();
                    $result = DB::connection('message')->table('lie_msg_channel_tpl')->insert($chn_tpl_model_wechatnotify);
                    if (!$result) {
                        $this->Export(11018, '新增消息模板失败');
                    }
                } else {
                    $chn_tpl_model_wechatnotify['update_time'] = time();
                    $result = DB::connection('message')->table('lie_msg_channel_tpl')->where('channel_tpl_id', $chn_tpl_model_wechatnotify['channel_tpl_id'])->update($chn_tpl_model_wechatnotify);
                    if (!$result) {
                        $this->Export(11019, '编辑消息模板失败');
                    }
李洋's avatar
update api
fc0928a2
 
李洋 committed 7 years ago
235
                }
李洋's avatar
1111
964b032b
 
李洋 committed 7 years ago
236 237 238 239
            } else {
                if (!empty($data['wechat_notify_tpl_id'])) {
                    $delete_result = DB::connection('message')->table('lie_msg_channel_tpl')->where('channel_tpl_id', $data['wechat_notify_tpl_id'])->delete();
                    if (!$delete_result) {
李洋's avatar
1、删除不勾选的模板渠道
b151a00e
 
李洋 committed 7 years ago
240 241 242
                        $this->Export(11019, '编辑消息模板失败');
                    }
                }
李洋's avatar
添加修改数据库api
d624e727
 
李洋 committed 7 years ago
243
            }
李洋's avatar
1111
964b032b
 
李洋 committed 7 years ago
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276
            if (strpos($data['channels'], '5') !== false) {
                if (empty($data['ding_content'])) {
                    $this->Export(11020, '请填写钉钉消息内容');
                }
                $chn_tpl_model_ding = [];
                $chn_tpl_model_ding['channel_tpl_id'] = $data['ding_channel_tpl_id'];
                $chn_tpl_model_ding['channel_type'] = $data['ding_channel_type'];

                $chn_tpl_model_ding['content'] = $data['ding_content'];
                $chn_tpl_model_ding['tpl_id'] = $insert_tpl_id;
                if (empty($chn_tpl_model_ding['channel_tpl_id'])) {
                    $chn_tpl_model_ding['create_time'] = time();
                    $chn_tpl_model_ding['update_time'] = time();
                    $result = DB::connection('message')->table('lie_msg_channel_tpl')->insert($chn_tpl_model_ding);
                    if (!$result) {
                        $this->Export(11021, '新增消息模板失败');
                    }
                } else {
                    $chn_tpl_model_ding['update_time'] = time();
                    $result = DB::connection('message')->table('lie_msg_channel_tpl')->where('channel_tpl_id', $chn_tpl_model_ding['channel_tpl_id'])->update($chn_tpl_model_ding);
                    if (!$result) {
                        $this->Export(11022, '编辑消息模板失败');
                    }
                }
            } else {
                if (!empty($data['ding_channel_tpl_id'])) {
                    $delete_result = DB::connection('message')->table('lie_msg_channel_tpl')->where('channel_tpl_id', $data['ding_channel_tpl_id'])->delete();
                    if (!$delete_result) {
                        $this->Export(11023, '编辑消息模板失败');
                    }
                }
            }
        });
李洋's avatar
修复更新模板问题
ff1bf2cd
 
李洋 committed 7 years ago
277
        $this->Export(0, empty($tpl_model['tpl_id']) ? '新增成功' : '修改成功');
李洋's avatar
添加修改数据库api
d624e727
 
李洋 committed 7 years ago
278
    }
李洋's avatar
手动发消息接口联调
cfe21d14
 
李洋 committed 7 years ago
279

李洋's avatar
添加修改数据库api
d624e727
 
李洋 committed 7 years ago
280 281 282 283
    //编辑手动消息
    //发送手动消息
    private function sendManualMessage($request)
    {
李洋's avatar
手动发消息接口联调
cfe21d14
 
李洋 committed 7 years ago
284
        $data = $request->input();
李洋's avatar
1、添加手动发送消息时 模板描述唯一性逻辑
ca8b07dd
 
李洋 committed 7 years ago
285 286 287 288 289 290 291 292
        $is_dumplicated = DB::connection('message')->table('lie_msg_tpl')->where('description',$data['description'])->first();
        if($is_dumplicated !== NULL)
        {
            $this->Export(11024, '已存在相同模板描述,请更换描述内容');
        }

        $url = '';
        $current_domain = $_SERVER['HTTP_HOST'];
李洋's avatar
配置调整
d44c7c60
 
李洋 committed 7 years ago
293 294 295 296
        if($current_domain === Config('msgconfig.domain_local'))
        {
            $url = Config('msgconfig.api_domain_local');
        }elseif ($current_domain === Config('msgconfig.domain_sz'))
李洋's avatar
1、添加手动发送消息时 模板描述唯一性逻辑
ca8b07dd
 
李洋 committed 7 years ago
297
        {
李洋's avatar
配置调整
d44c7c60
 
李洋 committed 7 years ago
298 299
            $url = Config('msgconfig.api_domain_sz');
        }elseif ($current_domain === Config('msgconfig.domain_release'))
李洋's avatar
1、添加手动发送消息时 模板描述唯一性逻辑
ca8b07dd
 
李洋 committed 7 years ago
300
        {
李洋's avatar
配置调整
d44c7c60
 
李洋 committed 7 years ago
301
            $url = Config('msgconfig.api_domain_release');
李洋's avatar
1、添加手动发送消息时 模板描述唯一性逻辑
ca8b07dd
 
李洋 committed 7 years ago
302
        }
李洋's avatar
fix bug
e9771a85
 
李洋 committed 7 years ago
303

李洋's avatar
手动发消息接口联调
cfe21d14
 
李洋 committed 7 years ago
304 305 306 307 308 309 310 311 312 313 314
        $params = [];
        $params['channels'] = $data['channels'];
        $params['msg_type'] = $data['msg_type'];
//        $params['creater'] = $data['creater'];
        $params['description'] = $data['description'];
        $params['title_1'] = $data['title_1'];
        $params['title_3'] = $data['title_3'];
        $params['content_1'] = $data['content_1'];
        $params['content_2'] = $data['content_2'];
        $params['content_3'] = $data['content_3'];
        $params['op_type'] = $data['op_type'];
李洋's avatar
微信
86ebc545
 
李洋 committed 7 years ago
315
        $params['url_1'] = $data['url_1'];
李洋's avatar
手动发消息接口联调
cfe21d14
 
李洋 committed 7 years ago
316
        $params['obj_user'] = $data['obj_user'];
李洋's avatar
微信
86ebc545
 
李洋 committed 7 years ago
317 318 319 320 321 322 323
        $params['title_4'] = $data['title_4'];
        $params['url_4'] = $data['url_4'];

        $wechat_head = $data['wechat_notify_head'];
        $wechat_tail = $data['wechat_notify_tail'];
        $wechat_content = json_encode(array('wechat_tpl_head'=>$wechat_head,'wechat_tpl_tail'=>$wechat_tail));
        $params['content_4'] = $wechat_content;
李洋's avatar
手动发消息接口联调
cfe21d14
 
李洋 committed 7 years ago
324 325 326 327 328 329 330 331
        $params['expect_send_time'] = $data['expect_send_time'];
        //csrf
        $check['k1'] = time();
        $check['k2'] = pwdhash($check['k1'],'fh6y5t4rr351d2c3bryi');
        $params['pf'] = 1;
        $params['k1'] = $check['k1'];
        $params['k2'] = $check['k2'];
        $response = json_decode(curl($url,$params,1),true);
李洋's avatar
111
771db551
 
李洋 committed 7 years ago
332

李洋's avatar
手动发消息接口联调
cfe21d14
 
李洋 committed 7 years ago
333
        $this->Export($response['err_code'], $response['err_msg']);
李洋's avatar
添加修改数据库api
d624e727
 
李洋 committed 7 years ago
334 335 336

    }
}