diff --git a/app/common/repositories/system/serve/ServeOrderRepository.php b/app/common/repositories/system/serve/ServeOrderRepository.php index d0d02a85..be43a534 100644 --- a/app/common/repositories/system/serve/ServeOrderRepository.php +++ b/app/common/repositories/system/serve/ServeOrderRepository.php @@ -139,7 +139,7 @@ class ServeOrderRepository extends BaseRepository $res = $this->{$type}($merId, $data); $key = $res['key']; $param = $res['param']; - + if(!$result = Cache::store('file')->get($key)){ $order_sn = app()->make(StoreOrderRepository::class)->getNewOrderId('cs'); $param['order_sn'] = $order_sn; diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index a90ab485..3a5d00df 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -48,6 +48,10 @@ use think\facade\Log; use think\facade\Queue; use crmeb\jobs\SendSmsJob; use crmeb\jobs\TestJob; +use crmeb\services\PayService; +use crmeb\services\CombinePayService; +use app\common\model\user\User; + use app\controller\api\Ceshi; /** @@ -60,8 +64,24 @@ class Auth extends BaseController { public function dotest() { - Queue::push(SendSmsJob::class, ['tempId' => 'ORDER_CREATE', 'id' => 101]); - return app('json')->success(); + $repository = app()->make(StoreOrderRepository::class); + $param = [ + "status" => 0, + "is_del" => 0, + "mer_id" => 5, + "type" => 10, + "meal_id" => 10, + "pay_type" => 1, + "attach" => "meal", + "order_info" => '{"type_id":10,"is_margin":1,"margin":"0.01"}', + "pay_price" => "0.01", + "order_sn" => "bzj" . date('YmdHis') . uniqid(), + "body" => uniqid(), + ]; + $payType = 'weixinApp'; + $service = new PayService($payType, $param); + $payInfo = $service->pay(User::where(['uid'=>1])->find()); + return app('json')->success($payInfo); } public function test()