init
This commit is contained in:
241
app/us/controller/Group.php
Executable file
241
app/us/controller/Group.php
Executable file
@@ -0,0 +1,241 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: ORICO
|
||||
* Date: 2018-09-21
|
||||
* Time: 17:36
|
||||
*/
|
||||
|
||||
namespace app\us\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 fan(){
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function charger(){
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
public function submission(){
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
public function honor(){
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function question(){
|
||||
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 search(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function transparent(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
public function headset(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function h_speed(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function decennial(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function ssd(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function oricoindex()
|
||||
{
|
||||
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 series_35(){
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function pssd(){
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function backup_treasure(){
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function backuper(){
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function report()
|
||||
{
|
||||
if ($this->customer_id <= 0)
|
||||
$this->redirect('/login.html');
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/********20230720 顶部导航栏目************/
|
||||
public function brand(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function product(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function achievement(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
public function fq(){
|
||||
|
||||
$where = ['stat' => 0, 'country_code' => $this->country_code];
|
||||
$order = [
|
||||
'sort' => 'asc',
|
||||
'id' => 'desc'
|
||||
];
|
||||
$fq_list = model('fq')->where($where)->order($order)->paginate(6);
|
||||
// echo model('question')->getLastSql();die;
|
||||
// tiaoshi($question_list->items());die;
|
||||
|
||||
$value = [
|
||||
'fq_list' => $fq_list->isEmpty() ? null : $fq_list->items(),
|
||||
'page' => $fq_list->render(),
|
||||
|
||||
];
|
||||
$this->assign($value);
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function query(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function Contact(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
public function tutorial(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function distributor(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function business(){
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
public function introduction(){
|
||||
|
||||
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