This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
namespace app\common\controller;
|
||||
|
||||
use app\common\controller\BaseController;
|
||||
use app\common\model\User;
|
||||
use app\common\model\UserGroupMembers;
|
||||
use app\common\traits\crud\CrudControllerTrait;
|
||||
use app\common\service\WordpressVisitorService;
|
||||
use support\Request;
|
||||
|
||||
class WordpressVisitorController extends BaseController
|
||||
{
|
||||
use CrudControllerTrait;
|
||||
|
||||
protected $noNeedLogin = ['whatsApp'];
|
||||
|
||||
protected $noNeedHeaderData = ['whatsApp'];
|
||||
|
||||
protected $service;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->service = new WordpressVisitorService();
|
||||
}
|
||||
|
||||
public function whatsApp(Request $request){
|
||||
try {
|
||||
$url = $this->service->whatsApp($request);
|
||||
return $this->success(['url' => $url]);
|
||||
} catch (\Throwable $e) {
|
||||
return $this->error($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表页数据格式化
|
||||
*
|
||||
* @param array $data
|
||||
* @return array
|
||||
*/
|
||||
// protected function indexFormat($data)
|
||||
// {
|
||||
// if (isset($data['created_at']))
|
||||
// $data['created_at'] = date('Y-m-d H:i:s', $data['created_at']);
|
||||
// if (isset($data['updated_at']))
|
||||
// $data['updated_at'] = date('Y-m-d H:i:s', $data['updated_at']);
|
||||
// return $data;
|
||||
// }
|
||||
}
|
||||
Reference in New Issue
Block a user