Просмотр исходного кода

Merge branch 'master' of ssh://git.9026.com:2212/Silent/RailwayTwo

Mike 3 лет назад
Родитель
Сommit
c0dbe057eb

+ 2 - 2
app/Http/Controllers/Admin/OrderController.php

xqd
@@ -40,8 +40,8 @@ class OrderController extends BaseController
 
     public function get(Request $request)
     {
-        $items = $this->model->where('id', '>', 0)->with('project', 'user');
-
+        $items = $this->model->where('id', '>', 0)->with('project', 'user')->orderBy('created_at', 'desc');
+    
         $tmp_items = collect(['order_number']);
         foreach($tmp_items as $tmp_item) {
             if($request->has($tmp_item) && !empty($request->input($tmp_item))) {

+ 45 - 30
app/Http/Controllers/Admin/TestController.php

xqd
@@ -14,35 +14,50 @@ 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', '13438082119')->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', '%1343808211%')->pluck('union_id'));
-//        $app = app('wechat.official_account.default');
-//        $res = $app->template_message->send([
-//            'touser' => 'oEDlJ5p8EFuHepjBi0cASmHjb7Qg',
-//            'template_id' => 'dlRsvUWqeziBvGbdT89b69slvZll6gZVRCotIXCwwjM',
-//            'miniprogram' => [
-//                'appid' => 'xxxxxxx',
-//                'pagepath' => 'pages/xxx',
-//            ],
-//            'data' => [
-//                'first' => '您有一条待审核的订单,请注意查看!',
-//                'keyword1' => '2010-01-01',
-//                'keyword2' => '设备租赁订单',
-//                'keyword3' => '待审核/机电负责人',
-//                'keyword4' => 'XX-项目',
-//                'keyword5' => 'XXXXXX',
-//                'remark' => '点击进入小程序查看详情,请及时处理。',
-//            ],
-//        ]);
-//        dd($res);
+        // 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);
     }
 }