123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- namespace App\Http\Controllers\Admin;
- use App\Models\Notification;
- use App\Models\Project;
- use App\Models\User;
- use App\Models\UserAuth;
- use App\Models\WorkPoint;
- use Illuminate\Http\Request;
- class TestController extends Controller
- {
- public function index(Request $request)
- {
- // dd(mb_substr('你好', 0, 1));
- // $info = Notification::orderBy('id', 'desc')->first();
- // dd($info->sendOfficialInfo());
- // return false;
- // $user = User::where('phone', '18980623975')->first();
- // User::where('phone', 'like', '%1343808211%')->update([
- // 'open_id' => $user->open_id,
- // 'union_id' => $user->union_id,
- // 'official_open_id' => $user->official_open_id
- // ]);
- // dd(User::where('phone', 'like', '%18980623975%')->first());
- // $open_id=User::where('phone', 'like', '%18980623975%')->pluck('open_id');
- // // dd($open_id[0]);
- // $content = [
- // 'name' => '租赁审批成功通知',
- // 'content' => '你的设备租赁申请已通过,请确认相关信息:',
- // 'official' => [
- // 'template_id' => 'dlRsvUWqeziBvGbdT89b69slvZll6gZVRCotIXCwwjM',
- // 'page' => 'pages/order-detail/index?id=1',
- // 'data' => [
- // 'first' => '您有一个订单已通过审核,请注意查看!',
- // 'keyword1' => '',
- // 'keyword2' => '',
- // 'keyword3' => '',
- // 'keyword4' => '',
- // 'keyword5' => '',
- // 'remark' => '点击进入小程序查看详情。',
- // ]
- // ]
- // ];
- // $info = $content['official'];
- // $official_app = app('wechat.mini_program.default');
- // $res = $official_app->uniform_message->send([
- // 'touser' => $open_id[0],
- // 'mp_template_msg' => [
- // 'appid'=>env('WECHAT_OFFICIAL_ACCOUNT_APPID'),
- // 'template_id' => $info['template_id'],
- // 'miniprogram' => [
- // 'appid' => env('WECHAT_MINI_PROGRAM_APPID'),
- // 'pagepath' => $info['page'],
- // ],
- // 'data' => $info['data'],
- // ]
- // ]);
- // dd($res);
- }
- }
|