|
@@ -1710,7 +1710,7 @@ class AlbumController extends Controller
|
|
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
|
|
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
|
|
*/
|
|
*/
|
|
private function sendLogsMessage($storeid,$open_id,$action,$name,$g_open_id)
|
|
private function sendLogsMessage($storeid,$open_id,$action,$name,$g_open_id)
|
|
- {\Log::info('111');
|
|
|
|
|
|
+ {
|
|
$user = AlbumUserModel::where('open_id',$open_id)->first();
|
|
$user = AlbumUserModel::where('open_id',$open_id)->first();
|
|
$formId = AlbumFormId::where([['open_id',$open_id]])->first();
|
|
$formId = AlbumFormId::where([['open_id',$open_id]])->first();
|
|
$content = '';
|
|
$content = '';
|
|
@@ -1741,28 +1741,9 @@ class AlbumController extends Controller
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
$weChatApp = AlbumManufacturerModel::where('store_id', $storeid)->first();\Log::info('2221');
|
|
$weChatApp = AlbumManufacturerModel::where('store_id', $storeid)->first();\Log::info('2221');
|
|
- $config = [
|
|
|
|
- 'app_id' => $weChatApp->G_app_id,
|
|
|
|
- 'secret' => $weChatApp->G_app_secret,
|
|
|
|
- 'response_type' => 'array',
|
|
|
|
- ];\Log::info('2224');
|
|
|
|
- $app = Factory::officialAccount($config);\Log::info('2225');
|
|
|
|
- $re_g = $app->template_message->send([
|
|
|
|
- 'touser' => $g_open_id,
|
|
|
|
- 'template_id' => 'lXMh2Xjg62C4LjB50QVi9ETbcvU21WElvqNCHBCsWuM',
|
|
|
|
- 'url' => 'https://f.9026.com',
|
|
|
|
- /* "miniprogram"=>[
|
|
|
|
- "appid"=>$weChatApp->app_id,
|
|
|
|
- "pagepath"=>"pages/sell/sell"
|
|
|
|
- ],*/
|
|
|
|
- 'data' => [
|
|
|
|
- 'key1' => $name,
|
|
|
|
- 'key2' => $content,
|
|
|
|
- 'key3' => date('Y-m-d H:i'),
|
|
|
|
- ],
|
|
|
|
- ]);
|
|
|
|
- \Log::info('2225');
|
|
|
|
- \Log::info($re_g);
|
|
|
|
|
|
+
|
|
|
|
+ $res_account = $this->accountMesage($g_open_id,$weChatApp,$name,$content);
|
|
|
|
+ \Log::info($res_account);
|
|
if($user&&$formId){
|
|
if($user&&$formId){
|
|
$config_app = [
|
|
$config_app = [
|
|
'app_id' => $weChatApp->app_id,
|
|
'app_id' => $weChatApp->app_id,
|
|
@@ -1789,6 +1770,43 @@ class AlbumController extends Controller
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * send account message
|
|
|
|
+ *
|
|
|
|
+ * @param $g_open_id string
|
|
|
|
+ * @param $weChatApp object
|
|
|
|
+ * @param $name string
|
|
|
|
+ * @param $content string
|
|
|
|
+ * @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
|
|
|
|
+ *
|
|
|
|
+ * @return array|string
|
|
|
|
+ */
|
|
|
|
+ private function accountMesage($g_open_id,$weChatApp,$name,$content)
|
|
|
|
+ {
|
|
|
|
+ if ($g_open_id) {
|
|
|
|
+ $config = [
|
|
|
|
+ 'app_id' => $weChatApp->G_app_id,
|
|
|
|
+ 'secret' => $weChatApp->G_app_secret,
|
|
|
|
+ 'response_type' => 'array',
|
|
|
|
+ ];\Log::info('2224');
|
|
|
|
+ $app = Factory::officialAccount($config);\Log::info('2225');
|
|
|
|
+ $res = $app->template_message->send([
|
|
|
|
+ 'touser' => $g_open_id,
|
|
|
|
+ 'template_id' => 'lXMh2Xjg62C4LjB50QVi9ETbcvU21WElvqNCHBCsWuM',
|
|
|
|
+ 'url' => '',
|
|
|
|
+ 'data' => [
|
|
|
|
+ 'key1' => $name,
|
|
|
|
+ 'key2' => $content,
|
|
|
|
+ 'key3' => date('Y-m-d H:i'),
|
|
|
|
+ ],
|
|
|
|
+ 'miniprogram' => [
|
|
|
|
+ 'appid' => $weChatApp->app_id,
|
|
|
|
+ 'pagepath' => 'pages/sell/sell'
|
|
|
|
+ ],
|
|
|
|
+ ]);
|
|
|
|
+ return $res;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
/**
|
|
/**
|
|
* @api {get} /api/album/add_agent 申请经销商(add_agent)
|
|
* @api {get} /api/album/add_agent 申请经销商(add_agent)
|
|
* @apiDescription 申请经销商(add_agent)
|
|
* @apiDescription 申请经销商(add_agent)
|