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