作者 Your Name
@@ -83,9 +83,11 @@ class MonthProjectCount extends Command @@ -83,9 +83,11 @@ class MonthProjectCount extends Command
83 $res = (new FormGlobalsoApi())->getInquiryAll($url,$v); 83 $res = (new FormGlobalsoApi())->getInquiryAll($url,$v);
84 echo date('Y-m-d H:i:s') . '月份:'.$v. PHP_EOL; 84 echo date('Y-m-d H:i:s') . '月份:'.$v. PHP_EOL;
85 $arr['total'] = $arr['month_total'] = 0; 85 $arr['total'] = $arr['month_total'] = 0;
  86 + echo date('Y-m-d H:i:s') . '返回值:'.json_encode($res) . PHP_EOL;
86 if(isset($res['data']['count'])){ 87 if(isset($res['data']['count'])){
87 echo date('Y-m-d H:i:s') . '数据:'.$res['data']['count'] . PHP_EOL; 88 echo date('Y-m-d H:i:s') . '数据:'.$res['data']['count'] . PHP_EOL;
88 $arr['month_total'] = $res['data']['count'] + InquiryFormData::getCount([$start.' 00:00:00',$end.' 00:00:00']); 89 $arr['month_total'] = $res['data']['count'] + InquiryFormData::getCount([$start.' 00:00:00',$end.' 00:00:00']);
  90 + echo date('Y-m-d H:i:s') . '加上其他询盘后的:'.$arr['month_total'] . PHP_EOL;
89 } 91 }
90 //获取上一个的count 92 //获取上一个的count
91 $previousMonth = date('Y-m', strtotime($v . ' -1 month')); 93 $previousMonth = date('Y-m', strtotime($v . ' -1 month'));
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :InquiryFieldController.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2024/8/13 10:45
  8 + */
  9 +
  10 +namespace App\Http\Controllers\Bside\Inquiry;
  11 +
  12 +use App\Enums\Common\Code;
  13 +use App\Http\Controllers\Bside\BaseController;
  14 +use App\Models\Inquiry\InquiryField;
  15 +
  16 +/**
  17 + * @remark :詢盤字段映射
  18 + * @name :InquiryFieldController
  19 + * @author :lyh
  20 + * @method :post
  21 + * @time :2024/8/13 10:45
  22 + */
  23 +class InquiryFieldController extends BaseController
  24 +{
  25 + /**
  26 + * @remark :詢盤字段映射
  27 + * @name :lists
  28 + * @author :lyh
  29 + * @method :post
  30 + * @time :2024/8/13 10:59
  31 + */
  32 + public function lists(){
  33 + $inquiryModel = new InquiryField();
  34 + $lists = $inquiryModel->list($this->map);
  35 + $this->response('success',Code::SUCCESS,$lists);
  36 + }
  37 +
  38 + /**
  39 + * @remark :保存數據
  40 + * @name :save
  41 + * @author :lyh
  42 + * @method :post
  43 + * @time :2024/8/13 11:13
  44 + */
  45 + public function save(){
  46 + $this->request->validate([
  47 + 'data'=>'required',
  48 + ],[
  49 + 'data.required' => 'data不能为空',
  50 + ]);
  51 + $inquiryModel = new InquiryField();
  52 + foreach ($this->param['data'] as $v){
  53 + if(isset($v['id']) && !empty($v['id'])){
  54 + $inquiryModel->edit(['en_name'=>$v['en_name']],['id'=>$v['id']]);
  55 + }else{
  56 + $inquiryModel->addReturnId(['name'=>$v['name'], 'en_name'=>$v['en_name']]);
  57 + }
  58 + }
  59 + $this->response('success');
  60 + }
  61 +
  62 + /**
  63 + * @remark :刪除數據
  64 + * @name :del
  65 + * @author :lyh
  66 + * @method :post
  67 + * @time :2024/8/13 11:14
  68 + */
  69 + public function del(){
  70 +
  71 + $this->request->validate([
  72 + 'id'=>'required',
  73 + ],[
  74 + 'id.required' => 'name不能为空',
  75 + ]);
  76 + $inquiryModel = new InquiryField();
  77 + $inquiryModel->del(['id'=>['in',$this->param['id']]]);
  78 + $this->response('success');
  79 + }
  80 +}
@@ -174,7 +174,7 @@ class ProductController extends BaseController @@ -174,7 +174,7 @@ class ProductController extends BaseController
174 $this->param['featured_status'] = $this->param['featured_status'] ?? 0; 174 $this->param['featured_status'] = $this->param['featured_status'] ?? 0;
175 if($this->param['featured_status'] != Category::STATUS_ACTIVE) { 175 if($this->param['featured_status'] != Category::STATUS_ACTIVE) {
176 $cateModel = new Category(); 176 $cateModel = new Category();
177 - $featured_ids = $cateModel->where('title', 'like', 'Featured%')->pluck('id')->toArray(); 177 + $featured_ids = $cateModel->formatQuery(['title'=>['in',['Featured','featured']]])->pluck('id')->toArray();
178 if(!empty($featured_ids)){ 178 if(!empty($featured_ids)){
179 $status = []; 179 $status = [];
180 if(isset($this->map['status'])){ 180 if(isset($this->map['status'])){
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 9
10 namespace App\Http\Logic\Aside\ExtensionModule; 10 namespace App\Http\Logic\Aside\ExtensionModule;
11 11
12 -use App\Http\Logic\Bside\BaseLogic; 12 +use App\Http\Logic\Aside\BaseLogic;
13 use App\Models\ExtentModule\ExtensionModule; 13 use App\Models\ExtentModule\ExtensionModule;
14 use App\Models\ExtentModule\ExtensionModuleField; 14 use App\Models\ExtentModule\ExtensionModuleField;
15 use App\Services\ProjectServer; 15 use App\Services\ProjectServer;
@@ -43,7 +43,8 @@ class ExtensionModuleLogic extends BaseLogic @@ -43,7 +43,8 @@ class ExtensionModuleLogic extends BaseLogic
43 if($info !== false){ 43 if($info !== false){
44 $this->fail('当前拓展数据名称已存在'); 44 $this->fail('当前拓展数据名称已存在');
45 } 45 }
46 - $this->param['data'] = empty($this->param['data']) ? null : json_encode($this->param['data']); 46 + $this->param['operator_id'] = $this->manager['id'];
  47 + $this->param['data'] = json_encode($this->param['data'] ?? []);
47 if(isset($this->param['id']) && !empty($this->param['id'])){ 48 if(isset($this->param['id']) && !empty($this->param['id'])){
48 $id = $this->param['id']; 49 $id = $this->param['id'];
49 $this->model->edit($this->param,['id'=>$id]); 50 $this->model->edit($this->param,['id'=>$id]);
@@ -578,6 +578,13 @@ Route::middleware(['bloginauth'])->group(function () { @@ -578,6 +578,13 @@ Route::middleware(['bloginauth'])->group(function () {
578 Route::any('/addModuleValue', [\App\Http\Controllers\Bside\ExtensionModule\ExtensionModuleController::class, 'addModuleValue'])->name('extension_module_addModuleValue'); 578 Route::any('/addModuleValue', [\App\Http\Controllers\Bside\ExtensionModule\ExtensionModuleController::class, 'addModuleValue'])->name('extension_module_addModuleValue');
579 Route::any('/editModuleValue', [\App\Http\Controllers\Bside\ExtensionModule\ExtensionModuleController::class, 'editModuleValue'])->name('extension_module_editModuleValue'); 579 Route::any('/editModuleValue', [\App\Http\Controllers\Bside\ExtensionModule\ExtensionModuleController::class, 'editModuleValue'])->name('extension_module_editModuleValue');
580 }); 580 });
  581 +
  582 + //自定义小语种文本信息
  583 + Route::prefix('inquiry_field')->group(function () {
  584 + Route::any('/', [\App\Http\Controllers\Bside\Inquiry\InquiryFieldController::class, 'lists'])->name('inquiry_field_lists');
  585 + Route::any('/save', [\App\Http\Controllers\Bside\Inquiry\InquiryFieldController::class, 'save'])->name('inquiry_field_save');
  586 + Route::any('/del', [\App\Http\Controllers\Bside\Inquiry\InquiryFieldController::class, 'del'])->name('inquiry_field_del');
  587 + });
581 }); 588 });
582 //无需登录验证的路由组 589 //无需登录验证的路由组
583 Route::group([], function () { 590 Route::group([], function () {