chenxiqiang пре 6 година
родитељ
комит
f4e903833d

+ 4
- 0
manage-server/app/Http/Controllers/CommonController.php Прегледај датотеку

@@ -3,6 +3,7 @@
3 3
 namespace App\Http\Controllers;
4 4
 
5 5
 use App\Models\Campaign;
6
+use App\Models\CompanyInfo;
6 7
 use App\Models\HouseApplianceCleanOrder;
7 8
 use App\Models\HouseCleanOrder;
8 9
 use App\Models\HousekeeperOrder;
@@ -293,6 +294,9 @@ class CommonController extends Controller
293 294
             case "server_info":
294 295
                 $record = ServerInfo::find($id);
295 296
                 break;
297
+            case "company_info":
298
+                $record = CompanyInfo::find($id);
299
+                break;
296 300
             default:
297 301
                 return null;
298 302
         }

+ 38
- 0
manage-server/app/Http/Controllers/CompanyInfoController.php Прегледај датотеку

@@ -0,0 +1,38 @@
1
+<?php
2
+
3
+namespace App\Http\Controllers;
4
+
5
+use Illuminate\Http\Request;
6
+use App\Models\CompanyInfo;
7
+
8
+class CompanyInfoController extends Controller
9
+{
10
+    /**
11
+     * 创建公司介绍
12
+     * @param Request $request
13
+     * @return \Illuminate\Http\JsonResponse
14
+     */
15
+    public function store(Request $request)
16
+    {
17
+        $id = $request->input('id');
18
+        $content = $request->input('content');
19
+        if ($id) {
20
+            $company = CompanyInfo::find($id);
21
+        } else {
22
+            $company = new CompanyInfo;
23
+        }
24
+        if ($content) {
25
+            $company->content = $content;
26
+            $company->save();
27
+            return Response()->json([
28
+                "status" => 0,
29
+                "message" => "保存成功!"
30
+            ]);
31
+        } else {
32
+            return Response()->json([
33
+                "status" => -1,
34
+                "message" => "信息不能为空!"
35
+            ]);
36
+        }
37
+    }
38
+}

+ 10
- 0
manage-server/app/Http/Controllers/WechatInfoController.php Прегледај датотеку

@@ -0,0 +1,10 @@
1
+<?php
2
+
3
+namespace App\Http\Controllers;
4
+
5
+use Illuminate\Http\Request;
6
+
7
+class WechatInfoController extends Controller
8
+{
9
+    //
10
+}

+ 12
- 0
manage-server/app/Models/CompanyInfo.php Прегледај датотеку

@@ -0,0 +1,12 @@
1
+<?php
2
+
3
+namespace App\Models;
4
+
5
+use Illuminate\Database\Eloquent\Model;
6
+
7
+class CompanyInfo extends Model
8
+{
9
+    protected $fillable = [
10
+        'content'
11
+    ];
12
+}

+ 13
- 0
manage-server/app/Models/WechatInfo.php Прегледај датотеку

@@ -0,0 +1,13 @@
1
+<?php
2
+
3
+namespace App\Models;
4
+
5
+use Illuminate\Database\Eloquent\Model;
6
+
7
+class WechatInfo extends Model
8
+{
9
+    protected $fillable = [
10
+        'openid', // openid
11
+        'session_key', // 活动内容
12
+    ];
13
+}

+ 1
- 0
manage-server/database/migrations/2018_08_10_075128_create_maternity_matron_orders_table.php Прегледај датотеку

@@ -28,6 +28,7 @@ class CreateMaternityMatronOrdersTable extends Migration
28 28
          */
29 29
         Schema::create('maternity_matron_orders', function (Blueprint $table) {
30 30
             $table->increments('id');
31
+            $table->string('wechat_id');
31 32
             $table->string('level');
32 33
             $table->string('expected_date');
33 34
             $table->string('server_time');

+ 33
- 0
manage-server/database/migrations/2018_09_09_151612_create_wechat_infos_table.php Прегледај датотеку

@@ -0,0 +1,33 @@
1
+<?php
2
+
3
+use Illuminate\Support\Facades\Schema;
4
+use Illuminate\Database\Schema\Blueprint;
5
+use Illuminate\Database\Migrations\Migration;
6
+
7
+class CreateWechatInfosTable extends Migration
8
+{
9
+    /**
10
+     * Run the migrations.
11
+     *
12
+     * @return void
13
+     */
14
+    public function up()
15
+    {
16
+        Schema::create('wechat_infos', function (Blueprint $table) {
17
+            $table->increments('id');
18
+            $table->string('openid');
19
+            $table->string('session_key');
20
+            $table->timestamps();
21
+        });
22
+    }
23
+
24
+    /**
25
+     * Reverse the migrations.
26
+     *
27
+     * @return void
28
+     */
29
+    public function down()
30
+    {
31
+        Schema::dropIfExists('wechat_infos');
32
+    }
33
+}

+ 32
- 0
manage-server/database/migrations/2018_09_09_161506_create_company_infos_table.php Прегледај датотеку

@@ -0,0 +1,32 @@
1
+<?php
2
+
3
+use Illuminate\Support\Facades\Schema;
4
+use Illuminate\Database\Schema\Blueprint;
5
+use Illuminate\Database\Migrations\Migration;
6
+
7
+class CreateCompanyInfosTable extends Migration
8
+{
9
+    /**
10
+     * Run the migrations.
11
+     *
12
+     * @return void
13
+     */
14
+    public function up()
15
+    {
16
+        Schema::create('company_infos', function (Blueprint $table) {
17
+            $table->increments('id');
18
+            $table->text('context');
19
+            $table->timestamps();
20
+        });
21
+    }
22
+
23
+    /**
24
+     * Reverse the migrations.
25
+     *
26
+     * @return void
27
+     */
28
+    public function down()
29
+    {
30
+        Schema::dropIfExists('company_infos');
31
+    }
32
+}

Loading…
Откажи
Сачувај