| xqd
@@ -1747,20 +1747,28 @@ class AlbumController extends Controller
|
|
|
'response_type' => 'array',
|
|
|
];\Log::info('2224');
|
|
|
$app = Factory::officialAccount($config);
|
|
|
- $text = new Text($content);\Log::info($text);
|
|
|
- $res_msg = $app->customer_service->message($text)->to($g_open_id)->send();\Log::info($res_msg);
|
|
|
+ $re_g = $app->template_message->send([
|
|
|
+ 'touser' => $g_open_id,
|
|
|
+ 'template_id' => 'lXMh2Xjg62C4LjB50QVi9ETbcvU21WElvqNCHBCsWuM',
|
|
|
+ 'url' => '',
|
|
|
+ "miniprogram"=>[
|
|
|
+ "appid"=>"$weChatApp->app_id",
|
|
|
+ "pagepath"=>"pages/sell/sell"
|
|
|
+ ],
|
|
|
+ 'data' => [
|
|
|
+ 'key1' => $name,
|
|
|
+ 'key2' => $content,
|
|
|
+ 'key3' => date('Y-m-d H:i'),
|
|
|
+ ],
|
|
|
+ ]);
|
|
|
if($user&&$formId){
|
|
|
- $this->wechat_app = AlbumManufacturerModel::where('store_id',$storeid)->first();
|
|
|
- $config = [
|
|
|
- 'app_id' => $this->wechat_app->app_id,
|
|
|
- 'secret' => $this->wechat_app->app_secret,
|
|
|
-
|
|
|
- // 下面为可选项
|
|
|
- // 指定 API 调用返回结果的类型:array(default)/collection/object/raw/自定义类名
|
|
|
+ $config_app = [
|
|
|
+ 'app_id' => $weChatApp->app_id,
|
|
|
+ 'secret' => $weChatApp->app_secret,
|
|
|
'response_type' => 'array',
|
|
|
];
|
|
|
- $app = Factory::miniProgram($config);
|
|
|
- $res = $app->template_message->send([
|
|
|
+ $app_x = Factory::miniProgram($config_app);
|
|
|
+ $res = $app_x->template_message->send([
|
|
|
'touser' => $open_id,
|
|
|
'template_id' => '9PDTfnhsRvdNwpPMIcYLL7wQF4SZkB8-9ZhXUfthbmw',
|
|
|
'page' => 'pages/sell/sell',
|
| xqd
@@ -1770,7 +1778,7 @@ class AlbumController extends Controller
|
|
|
'keyword2' => $content,
|
|
|
'keyword3' => date('Y-m-d H:i'),
|
|
|
],
|
|
|
- ]);\Log::info($res);
|
|
|
+ ]);\Log::info($re_g);
|
|
|
// dd($res);
|
|
|
if($res){
|
|
|
$formId->delete();
|