...
|
...
|
@@ -123,36 +123,46 @@ class AdminOrderController extends AdminBaseController |
|
|
$hire_res = $hireModel->isUpdate(true)->save($hire_save);
|
|
|
if($res && $hire_res){
|
|
|
// 发送模板消息
|
|
|
$acctoken = $this->getAccessToken();
|
|
|
$url = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=".$acctoken;
|
|
|
$data = array();
|
|
|
$data['touser'] = 'oxr6j0gF6bDVDEOG_-Ttz2cRUbVQ';//OPENID
|
|
|
$data['template_id'] = 'YUC7jOhDQ_kWRumosx_aLFh_ReKjcrZOdbV-zVfRf14';
|
|
|
$data['url'] = 'http://yunzhi07.com/';//模板跳转链接
|
|
|
$data['data']['first']['value'] = '您好!你发布的职位通过审核。';//模板数据
|
|
|
$data['data']['keyword1']['value'] = '程序员';//模板数据
|
|
|
$data['data']['keyword2']['value'] = '一步人才网';//模板数据
|
|
|
$data['data']['keyword3']['value'] = '3人';//模板数据
|
|
|
$data['data']['keyword4']['value'] = '5000-6000元/月';//模板数据
|
|
|
$data['data']['keyword5']['value'] = '0471-3388866';//模板数据
|
|
|
$data['data']['remark']['value'] = '如有其他问题,请及时与我们联系!';//模板数据
|
|
|
|
|
|
|
|
|
|
|
|
$where_hire['h.id'] = $order['hire_id'];
|
|
|
$where_hire['h.status'] = array('neq',9);
|
|
|
$hire = Db::name('Hire')->alias('h')
|
|
|
->where($where_hire)
|
|
|
->join("Member m",'m.id = h.user_id')
|
|
|
->field('m.openid, h.*')
|
|
|
->find();
|
|
|
|
|
|
|
|
|
$acctoken = $this->getAccessToken();
|
|
|
$url = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=".$acctoken;
|
|
|
$send = array();
|
|
|
$send['touser'] = $hire['openid'];//OPENID
|
|
|
$send['template_id'] = 'YUC7jOhDQ_kWRumosx_aLFh_ReKjcrZOdbV-zVfRf14';
|
|
|
$send['url'] = 'http://yunzhi07.com/';//模板跳转链接
|
|
|
if($data['status'] == 3){
|
|
|
// 审核通过
|
|
|
$send['data']['first']['value'] = '您好,您的审核已通过,请您尽快完成付款,请查看订单详情。';//模板数据
|
|
|
}else if($data['status'] == 4){
|
|
|
// 审核未通过
|
|
|
$send['data']['first']['value'] = "抱歉,您的审核未通过,原因为".$data['refund'].",请查看订单详";//模板数据
|
|
|
}
|
|
|
$send['data']['keyword1']['value'] = '程序员';//模板数据
|
|
|
$send['data']['keyword2']['value'] = '一步人才网';//模板数据
|
|
|
$send['data']['keyword3']['value'] = '3人';//模板数据
|
|
|
$send['data']['keyword4']['value'] = '5000-6000元/月';//模板数据
|
|
|
$send['data']['keyword5']['value'] = '0471-3388866';//模板数据
|
|
|
$send['data']['remark']['value'] = '如有其他问题,请及时与我们联系!';//模板数据
|
|
|
$ch = curl_init();//初始化curl
|
|
|
curl_setopt($ch, CURLOPT_URL,$url);//抓取指定网页
|
|
|
curl_setopt($ch, CURLOPT_HEADER, 0);//设置header
|
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);//要求结果为字符串且输出到屏幕上
|
|
|
curl_setopt($ch, CURLOPT_POST, 1);//post提交方式
|
|
|
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
|
|
|
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($send));
|
|
|
$res = curl_exec($ch);//运行curl
|
|
|
|
|
|
|
|
|
$a = file_get_contents($res);
|
|
|
// $a = file_get_contents($res);
|
|
|
echo "<pre/>";
|
|
|
print_r($a);
|
|
|
print_r($res);
|
|
|
die;
|
|
|
Db::commit();
|
|
|
$this->apiResponse('1','操作成功');
|
...
|
...
|
|