|
@@ -0,0 +1,43 @@
|
|
|
|
+<?php
|
|
|
|
+
|
|
|
|
+class retailControl extends vbaseControl
|
|
|
|
+{
|
|
|
|
+ public function __construct()
|
|
|
|
+ {
|
|
|
|
+ parent::__construct();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public function retail_recordOp()
|
|
|
|
+ {
|
|
|
|
+ $channel_code = $_POST['channel_code'];
|
|
|
|
+ if(empty($channel_code)) {
|
|
|
|
+ return self::outerr(300,"渠道信息有误.");
|
|
|
|
+ }
|
|
|
|
+ $province = $_POST['province'] ?? '';
|
|
|
|
+ $city = $_POST['city'] ?? '';
|
|
|
|
+ $area = $_POST['area'] ?? '';
|
|
|
|
+ $address = $_POST['address'] ?? '';
|
|
|
|
+ if(empty($province) || empty($city) || empty($area) || empty($address)) {
|
|
|
|
+ return self::outerr(300,"地址信息有误.");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $applicant_name = $_POST['applicant_name'];
|
|
|
|
+ $contact_phone = $_POST['contact_phone'];
|
|
|
|
+ if(empty($applicant_name) || empty($contact_phone)) {
|
|
|
|
+ return self::outerr(300,"联系人信息有误.");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $params = [
|
|
|
|
+ 'channel_code' => $channel_code, 'province' => $province, 'city' => $city, 'area' => $area,
|
|
|
|
+ 'address' => $address, 'applicant_name' => $applicant_name, 'contact_phone' => $contact_phone,
|
|
|
|
+ 'create_time' => time()
|
|
|
|
+ ];
|
|
|
|
+
|
|
|
|
+ $resp = Model('')->table('retail')->insert($params);
|
|
|
|
+ if ($resp) {
|
|
|
|
+ return self::outsuccess([]);
|
|
|
|
+ } else {
|
|
|
|
+ return self::outerr(301, "录入信息失败.");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|