init
This commit is contained in:
187
app/usmobile/controller/Group20191213.php
Executable file
187
app/usmobile/controller/Group20191213.php
Executable file
@@ -0,0 +1,187 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: ORICO
|
||||
* Date: 2018-09-21
|
||||
* Time: 17:36
|
||||
*/
|
||||
|
||||
namespace app\usmobile\controller;
|
||||
|
||||
|
||||
class Group extends BaseController
|
||||
{
|
||||
public function index(){
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function odm(){
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function special(){
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function job(){
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function policy(){
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function culture(){
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function decennial(){
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function Contact(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function fq(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function honor(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function industry(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function weare(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function wewill(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function vision(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function rdcenter(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function brand(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function search(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function transparent(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function distributor(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function headset(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function socket(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function charger(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function fan(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function ufo(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function faq(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function h_speed(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function ssd(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function thunderbolt_3(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function stripe(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function series_95(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function report()
|
||||
{
|
||||
/* if ($this->customer_id <= 0)
|
||||
$this->redirect('/login.html');*/
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
public function create_report()
|
||||
{
|
||||
if ($this->customer_id <= 0)
|
||||
return $this->json(-100, 'Please log on first');
|
||||
|
||||
$data = $this->request->post();
|
||||
if (empty($data) || !is_array($data))
|
||||
return $this->json(-1, 'Data error ');
|
||||
|
||||
if ($data['product_name'] == '')
|
||||
return $this->json(-2, 'Product name cannot be empty');
|
||||
if ($data['product_model'] == '')
|
||||
return $this->json(-3, 'Product model cannot be empty');
|
||||
if ($data['product_manufacturer'] == '')
|
||||
return $this->json(-4, 'Manufacturer name cannot be empty');
|
||||
// if ($data['buy_source'] == '')
|
||||
// return $this->json(-5, '购买渠道不能为空');
|
||||
|
||||
if ($data['customer_telephone'] != '' && !preg_match("/^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/", $data['customer_telephone']))
|
||||
return $this->json(-6, 'Phone format error ');
|
||||
if ($data['customer_email'] != '' && !preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,})$/", $data['customer_email']))
|
||||
return $this->json(-7, 'Email Address format error');
|
||||
|
||||
$insert_data = [
|
||||
'customer_id' => $this->customer_id,
|
||||
'product_name' => $data['product_name'],
|
||||
'product_model' => $data['product_model'],
|
||||
'product_manufacturer' => $data['product_manufacturer'],
|
||||
'buy_source' => $data['buy_source'],
|
||||
'product_price' => floatval($data['product_price']),
|
||||
'customer_name' => $data['customer_name'],
|
||||
'customer_email' => $data['customer_email'],
|
||||
'customer_telephone' => $data['customer_telephone'],
|
||||
'description' => $data['description'],
|
||||
'create_time' => time(),
|
||||
];
|
||||
|
||||
$result = model('report')->insert($insert_data);
|
||||
if (!$result)
|
||||
return $this->json(-8, 'Failure to submit');
|
||||
|
||||
return $this->json(200, 'ok');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user