|
|
|
@ -16,10 +16,10 @@ class Wxserver extends BaseController |
|
|
|
|
public function index() |
|
|
|
|
{ |
|
|
|
|
$appid = 'wx74c7a92ae5ffbcb6'; |
|
|
|
|
$template_id = 6; |
|
|
|
|
$obj = new \app\common\library\wxserver\Server(); |
|
|
|
|
$arr = $obj->getQrcode($appid); |
|
|
|
|
return $this->renderSuccess(['arr' => $arr]); |
|
|
|
|
$arr = $obj->release('wxe3ed157849bd07b5'); |
|
|
|
|
$arr2 = $obj->release('wx896520d9d03f108f'); |
|
|
|
|
return $this->renderSuccess(['arr' => $arr, 'arr2' => $arr2]); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -51,7 +51,6 @@ class Wxserver extends BaseController |
|
|
|
|
public function callback($appid) |
|
|
|
|
{ |
|
|
|
|
$time = date('Y-m-d H:i:s'); |
|
|
|
|
Db::table('yoshop_wx_server')->insertGetId(['content' => '推送开始', 'created_at' => $time]); |
|
|
|
|
$obj = new \app\common\library\wxserver\Server(); |
|
|
|
|
$signature = $this->request->get('signature'); |
|
|
|
|
$timestamp = $this->request->get('timestamp'); |
|
|
|
@ -60,7 +59,6 @@ class Wxserver extends BaseController |
|
|
|
|
if ($obj->checkSignature($signature, $timestamp, $nonce)) { |
|
|
|
|
$xmlData = file_get_contents("php://input"); |
|
|
|
|
if ($xmlData) { |
|
|
|
|
Db::table('yoshop_wx_server')->insertGetId(['content' => $xmlData, 'created_at' => $time]); |
|
|
|
|
$data = $obj->decryptXml($xmlData); |
|
|
|
|
Db::table('yoshop_wx_server')->insertGetId(['content' => json_encode($data), 'created_at' => $time]); |
|
|
|
|
if (!empty($data['MsgType'])) { |
|
|
|
@ -68,6 +66,7 @@ class Wxserver extends BaseController |
|
|
|
|
$up = []; |
|
|
|
|
if ($data['Event'] == 'weapp_audit_success') { |
|
|
|
|
$up['audit_status'] = 2; |
|
|
|
|
$obj->release($appid);//审核通过发布版本 |
|
|
|
|
} elseif ($data['Event'] == 'weapp_audit_fail') { |
|
|
|
|
$up['audit_status'] = 3; |
|
|
|
|
} elseif ($data['Event'] == 'weapp_audit_delay') { |
|
|
|
|