erp_old/app/api/controller/IndexController.php

52 lines
1.5 KiB
PHP
Raw Normal View History

2023-09-20 13:54:09 +08:00
<?php
namespace app\api\controller;
2024-05-15 14:22:40 +08:00
use app\admin\logic\operation\OpurchaseclassLogic;
2024-01-20 22:40:47 +08:00
use app\admin\validate\tools\GenerateTableValidate;
use app\admin\logic\tools\GeneratorLogic;
2024-05-08 10:27:06 +08:00
use app\common\service\pay\PayService;
2024-05-14 16:11:08 +08:00
use app\common\service\wechat\WeChatMnpService;
2024-05-08 10:27:06 +08:00
use app\common\service\wechat\WeChatOaService;
2024-05-14 17:30:17 +08:00
use DateTime;
2024-05-10 11:31:45 +08:00
use Webman\Config;
2024-05-10 14:21:10 +08:00
use Webman\RedisQueue\Redis;
2024-05-10 11:31:45 +08:00
use Yansongda\Pay\Pay;
2024-05-10 14:21:10 +08:00
use Webman\Push\Api;
2024-01-20 22:40:47 +08:00
2024-04-26 11:26:12 +08:00
class IndexController extends BaseApiController
2024-01-20 22:40:47 +08:00
{
2024-04-26 11:26:12 +08:00
public $notNeedLogin = ['index'];
2024-01-20 22:40:47 +08:00
public function index()
{
2024-05-14 17:56:33 +08:00
2024-05-15 14:22:40 +08:00
// $extra=$this->request->post();
// Redis::send('push-supplier-products', ['order_id'=>11]);
// createSupplierGoods
d(OpurchaseclassLogic::createSupplierGoods(['goods'=>99]));
2024-05-10 14:21:10 +08:00
$queue = 'send-mail';
// 数据,可以直接传数组,无需序列化
$data = ['to' => 'tom@gmail.com', 'content' => 'hello'];
// 投递消息
Redis::send($queue, $data);
// 投递延迟消息消息会在60秒后处理
2024-05-10 17:55:36 +08:00
// Redis::send($queue, $data, 5);
2024-05-10 14:21:10 +08:00
2024-03-22 15:59:25 +08:00
return json(['msg' =>create_password(123456, '11d3')]);
2023-09-20 13:54:09 +08:00
}
2024-01-20 22:40:47 +08:00
/**
* @notes 下载文件
*/
public function download()
{
$params = (new GenerateTableValidate())->goCheck('download');
$result = GeneratorLogic::download($params['file']);
if (false === $result) {
return $this->fail(GeneratorLogic::getError() ?: '下载失败');
}
return response()->download($result, 'webman-curd.zip');
}
}