| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- namespace App\Http\Controllers\Api;
- use App\Jobs\ProcessDataJob;
- use App\Model\Record;
- use App\Service\EnterpriseWechatService;
- use App\Service\U8ThirdPartyService;
- class TestController extends BaseController
- {
- public function test(){
- // $record = Record::where('id',1065)->first()->toArray();
- $service = new U8ThirdPartyService();
- // list($status, $msg) = $service->puAppVouch($record);
- // list($status, $msg) = $service->poPomain($record);
- // list($status, $msg) = $service->purchaseInAdd($record);
- // dd($status, $msg);
- }
- private function submitAgain(){
- $result = Record::where('del_time',2)
- ->where('result', '<>', '')
- ->get()->toArray();
- foreach ($result as $value){
- ProcessDataJob::dispatch($value)->onQueue(Record::$job);
- }
- dd('ok');
- }
- public function sendNotification()
- {
- $wechatService = new EnterpriseWechatService();
- // 1. 目标员工的企业微信 userid(可在企业微信通讯录查看)
- $userId = 'chen';
- // 2. 组装卡片标题
- $title = '台风防汛紧急通知';
- // 3. 组装卡片内容(可以自由排版,比微信模板消息爽多了)
- $description = "<div class=\"gray\">2026年7月10日</div>"
- . "<div class=\"highlight\">【重要提醒】第9号台风“巴威”正在逼近!</div>"
- . "<br/>"
- . "当前状态:温州市已启动防台风Ⅱ级应急响应<br/>"
- . "防御要求:沿海大闸已密集泄洪,请各部门排查低洼处积水隐患,检查门窗是否关紧。<br/>"
- . "<br/>"
- . "通知部门:行政安全部";
- // 4. 点击卡片要跳转的系统系统链接
- $url = 'https://your-system.com/dashboard';
- // 5. 调用你刚才写好的方法
- list($status, $msg) = $wechatService->sendTextCard($userId, $title, $description, $url);
- dd($status, $msg);
- }
- }
|