wangmingchuan 9 months ago
parent 2581489402
commit c3bfef9ff2
  1. 8
      .idea/.gitignore
  2. 4
      .idea/deployment.xml
  3. 2
      .idea/webServers.xml
  4. 170
      .idea/workspace.xml
  5. 175
      app/api/controller/v1/LoginController.php
  6. 134
      app/api/controller/v1/complaint/ComplaintController.php
  7. 22
      app/api/controller/v1/publics/ArticleCategoryController.php
  8. 1
      app/services/user/LoginServices.php
  9. 14
      crmeb/services/FileService.php
  10. 464
      public/admin/index.html
  11. 14325
      public/admin/system_static/js/app.77d17773.js
  12. 225
      public/admin/system_static/js/chunk-2d226c9d.c64c2c15.js
  13. 1839
      public/admin/system_static/js/chunk-78e58f85.ec95ea87.js

8
.idea/.gitignore vendored

@ -1,8 +0,0 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PublishConfigData" autoUpload="On explicit save action" serverName="1" remoteFilesAllowedToDisappearOnAutoupload="false">
<component name="PublishConfigData" autoUpload="On explicit save action" serverName="11" remoteFilesAllowedToDisappearOnAutoupload="false">
<serverData>
<paths name="1">
<paths name="11">
<serverdata>
<mappings>
<mapping deploy="/" local="$PROJECT_DIR$" web="/" />

@ -2,7 +2,7 @@
<project version="4">
<component name="WebServers">
<option name="servers">
<webServer id="709c973a-72c9-4cea-8f44-88c7e1729ea5" name="1" url="http://47.103.53.180">
<webServer id="660164f9-05f8-4f53-9f18-63423049d162" name="11" url="http://47.103.53.180">
<fileTransfer host="47.103.53.180" port="21">
<advancedOptions>
<advancedOptions dataProtectionLevel="Private" passiveMode="true" shareSSLContext="true" />

@ -0,0 +1,170 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="48814c61-6f31-484c-b247-2bbbb849455d" name="变更" comment="">
<change beforePath="$PROJECT_DIR$/.idea/.gitignore" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/deployment.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/deployment.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/webServers.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/webServers.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/api/controller/v1/LoginController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/api/controller/v1/LoginController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/api/controller/v1/complaint/ComplaintController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/api/controller/v1/complaint/ComplaintController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/api/controller/v1/publics/ArticleCategoryController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/api/controller/v1/publics/ArticleCategoryController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/services/user/LoginServices.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/services/user/LoginServices.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/crmeb/services/FileService.php" beforeDir="false" afterPath="$PROJECT_DIR$/crmeb/services/FileService.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/public/admin/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/public/admin/index.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/public/admin/system_static/js/app.77d17773.js" beforeDir="false" afterPath="$PROJECT_DIR$/public/admin/system_static/js/app.77d17773.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/public/admin/system_static/js/chunk-2d226c9d.c64c2c15.js" beforeDir="false" afterPath="$PROJECT_DIR$/public/admin/system_static/js/chunk-2d226c9d.c64c2c15.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/public/admin/system_static/js/chunk-78e58f85.ec95ea87.js" beforeDir="false" afterPath="$PROJECT_DIR$/public/admin/system_static/js/chunk-78e58f85.ec95ea87.js" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ComposerSettings" synchronizationState="SYNCHRONIZE">
<pharConfigPath>$PROJECT_DIR$/composer.json</pharConfigPath>
<execution />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="GitSEFilterConfiguration">
<file-type-list>
<filtered-out-file-type name="LOCAL_BRANCH" />
<filtered-out-file-type name="REMOTE_BRANCH" />
<filtered-out-file-type name="TAG" />
<filtered-out-file-type name="COMMIT_BY_MESSAGE" />
</file-type-list>
</component>
<component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</component>
<component name="PhpWorkspaceProjectConfiguration">
<include_path>
<path value="$PROJECT_DIR$/vendor/fastknife/ajcaptcha" />
<path value="$PROJECT_DIR$/vendor/alipaysdk/easysdk" />
<path value="$PROJECT_DIR$/vendor/godruoyi/php-snowflake" />
<path value="$PROJECT_DIR$/vendor/danielstjules/stringy" />
<path value="$PROJECT_DIR$/vendor/mtdowling/jmespath.php" />
<path value="$PROJECT_DIR$/vendor/grpc/grpc" />
<path value="$PROJECT_DIR$/vendor/doctrine/cache" />
<path value="$PROJECT_DIR$/vendor/doctrine/lexer" />
<path value="$PROJECT_DIR$/vendor/overtrue/wechat" />
<path value="$PROJECT_DIR$/vendor/doctrine/annotations" />
<path value="$PROJECT_DIR$/vendor/qcloud_sts/qcloud-sts-sdk" />
<path value="$PROJECT_DIR$/vendor/overtrue/socialite" />
<path value="$PROJECT_DIR$/vendor/qcloud/cos-sdk-v5" />
<path value="$PROJECT_DIR$/vendor/phpoffice/phpspreadsheet" />
<path value="$PROJECT_DIR$/vendor/volcengine/volc-sdk-php" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/psr7" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/promises" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/guzzle" />
<path value="$PROJECT_DIR$/vendor/markbaker/matrix" />
<path value="$PROJECT_DIR$/vendor/markbaker/complex" />
<path value="$PROJECT_DIR$/vendor/qiniu/php-sdk" />
<path value="$PROJECT_DIR$/vendor/xaboy/form-builder" />
<path value="$PROJECT_DIR$/vendor/xin/container" />
<path value="$PROJECT_DIR$/vendor/xin/helper" />
<path value="$PROJECT_DIR$/vendor/league/flysystem" />
<path value="$PROJECT_DIR$/vendor/league/mime-type-detection" />
<path value="$PROJECT_DIR$/vendor/myclabs/php-enum" />
<path value="$PROJECT_DIR$/vendor/topthink/think-queue" />
<path value="$PROJECT_DIR$/vendor/alibabacloud/iot-20180120" />
<path value="$PROJECT_DIR$/vendor/topthink/think-view" />
<path value="$PROJECT_DIR$/vendor/alibabacloud/dysmsapi-20170525" />
<path value="$PROJECT_DIR$/vendor/symfony/translation-contracts" />
<path value="$PROJECT_DIR$/vendor/composer" />
<path value="$PROJECT_DIR$/vendor/topthink/think-helper" />
<path value="$PROJECT_DIR$/vendor/alibabacloud/darabonba-openapi" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" />
<path value="$PROJECT_DIR$/vendor/topthink/think-migration" />
<path value="$PROJECT_DIR$/vendor/alibabacloud/endpoint-util" />
<path value="$PROJECT_DIR$/vendor/symfony/translation" />
<path value="$PROJECT_DIR$/vendor/topthink/think-factory" />
<path value="$PROJECT_DIR$/vendor/alibabacloud/tea-utils" />
<path value="$PROJECT_DIR$/vendor/symfony/var-dumper" />
<path value="$PROJECT_DIR$/vendor/topthink/think-captcha" />
<path value="$PROJECT_DIR$/vendor/alibabacloud/credentials" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php72" />
<path value="$PROJECT_DIR$/vendor/topthink/think-filesystem" />
<path value="$PROJECT_DIR$/vendor/alibabacloud/gateway-spi" />
<path value="$PROJECT_DIR$/vendor/symfony/psr-http-message-bridge" />
<path value="$PROJECT_DIR$/vendor/topthink/framework" />
<path value="$PROJECT_DIR$/vendor/alibabacloud/linkvisual-20180120" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-normalizer" />
<path value="$PROJECT_DIR$/vendor/topthink/think-orm" />
<path value="$PROJECT_DIR$/vendor/alibabacloud/tea-fileform" />
<path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher" />
<path value="$PROJECT_DIR$/vendor/topthink/think-template" />
<path value="$PROJECT_DIR$/vendor/alibabacloud/tea-xml" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-idn" />
<path value="$PROJECT_DIR$/vendor/topthink/think-image" />
<path value="$PROJECT_DIR$/vendor/alibabacloud/openapi-util" />
<path value="$PROJECT_DIR$/vendor/guzzle/guzzle" />
<path value="$PROJECT_DIR$/vendor/symfony/http-foundation" />
<path value="$PROJECT_DIR$/vendor/topthink/think-multi-app" />
<path value="$PROJECT_DIR$/vendor/alibabacloud/tea" />
<path value="$PROJECT_DIR$/vendor/symfony/process" />
<path value="$PROJECT_DIR$/vendor/dh2y/think-qrcode" />
<path value="$PROJECT_DIR$/vendor/pimple/pimple" />
<path value="$PROJECT_DIR$/vendor/intervention/image" />
<path value="$PROJECT_DIR$/vendor/spatie/macroable" />
<path value="$PROJECT_DIR$/vendor/google/longrunning" />
<path value="$PROJECT_DIR$/vendor/lizhichao/one-sm" />
<path value="$PROJECT_DIR$/vendor/google/gax" />
<path value="$PROJECT_DIR$/vendor/lizhichao/word" />
<path value="$PROJECT_DIR$/vendor/google/protobuf" />
<path value="$PROJECT_DIR$/vendor/google/grpc-gcp" />
<path value="$PROJECT_DIR$/vendor/aws/aws-sdk-php" />
<path value="$PROJECT_DIR$/vendor/google/auth" />
<path value="$PROJECT_DIR$/vendor/google/common-protos" />
<path value="$PROJECT_DIR$/vendor/ralouphie/getallheaders" />
<path value="$PROJECT_DIR$/vendor/adbario/php-dot-notation" />
<path value="$PROJECT_DIR$/vendor/songshenzong/support" />
<path value="$PROJECT_DIR$/vendor/workerman/crontab" />
<path value="$PROJECT_DIR$/vendor/workerman/channel" />
<path value="$PROJECT_DIR$/vendor/aliyuncs/oss-sdk-php" />
<path value="$PROJECT_DIR$/vendor/monolog/monolog" />
<path value="$PROJECT_DIR$/vendor/workerman/workerman" />
<path value="$PROJECT_DIR$/vendor/psr/http-message" />
<path value="$PROJECT_DIR$/vendor/psr/simple-cache" />
<path value="$PROJECT_DIR$/vendor/nesbot/carbon" />
<path value="$PROJECT_DIR$/vendor/psr/log" />
<path value="$PROJECT_DIR$/vendor/psr/cache" />
<path value="$PROJECT_DIR$/vendor/psr/container" />
<path value="$PROJECT_DIR$/vendor/maennchen/zipstream-php" />
<path value="$PROJECT_DIR$/vendor/firebase/php-jwt" />
</include_path>
</component>
<component name="ProjectId" id="2ccIJtmlE8QtlNmkLqABL0IL1Pz" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/app/api/controller/v1/complaint" />
<property name="vue.rearranger.settings.migration" value="true" />
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="D:\shipin\app\api\controller\v1\complaint" />
</key>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="默认任务">
<changelist id="48814c61-6f31-484c-b247-2bbbb849455d" name="变更" comment="" />
<created>1708404371939</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1708404371939</updated>
<workItem from="1708404374246" duration="21740000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
</project>

@ -11,9 +11,13 @@
namespace app\api\controller\v1;
use app\adminapi\controller\AuthController;
use app\model\crud\School;
use app\model\user\User;
use app\Request;
use app\services\message\notice\SmsService;
use app\services\wechat\WechatServices;
use PhpOffice\PhpSpreadsheet\IOFactory;
use think\facade\Config;
use crmeb\services\CacheService;
use app\services\user\LoginServices;
@ -24,13 +28,14 @@ use app\services\user\UserServices;
use think\exception\ValidateException;
use app\api\validate\user\RegisterValidates;
use think\facade\Db;
/**
* 微信小程序授权类
* Class AuthController
* @package app\api\controller
*/
class LoginController
class LoginController extends AuthController
{
protected $services;
@ -224,31 +229,34 @@ class LoginController
{
[$type, $code] = $request->postMore([['type', ''], ['code', '']], true);
$code = $code[0];
switch ($code) {
case 'X':
return $this->teacherRegister($request, 1);
break;
case 'B':
return $this->parentsRegister($request, 2);
break;
case 'P':
if ($request['ttp'] == 2) {
if ($type == 'teacher') {
return $this->teacherRegister2($request, 1);
}
if ($type == 'parents') {
return $this->parentsRegister2($request, 2);
}
if ($type == 'relatives') {
return $this->relativesRegister($request, 3);
break;
default:
return app('json')->fail(500050);
break;
}
// if ($type == 'teacher') {
// return $this->teacherRegister($request, 1);
// }
// if ($type == 'parents') {
// return $this->parentsRegister($request, 2);
// }
// if ($type == 'relatives') {
// return $this->relativesRegister($request, 3);
// }
// return app('json')->fail(500050);
}
} else {
switch ($code) {
case 'X':
return $this->teacherRegister($request, 1);
break;
case 'B':
return $this->parentsRegister($request, 2);
break;
case 'P':
return $this->relativesRegister($request, 3);
break;
default:
return app('json')->fail(500050);
break;
}
}
return app('json')->fail(500050);
}
/**
@ -283,6 +291,48 @@ class LoginController
}
}
/**
* 老师注册
*/
private function teacherRegister2($request, $type)
{
[$account, $password, $code, $school_name, $teacher_name] = $request->postMore(
[
['account', ''],
['password', '88888888'],
['code', ''],
['school_name', ''],
['real_name', '']
],
true
);
try {
validate(RegisterValidates::class)->scene('TeacherRegister')->check(
['account' => $account, 'password' => $password, 'code' => $code, 'teacher_name' => $teacher_name]
);
// $SchoolServices = app()->make(SchoolServices::class);
// $schoolData = $SchoolServices->selectSchoolCodeData($code);
//
// if ($schoolData === true) {
// //邀请码无效
//// throw new ValidateException(410073);
// }
// if ($schoolData['school_name'] != $school_name) {
// throw new ValidateException(500051);
// }
} catch (ValidateException $e) {
return app('json')->fail($e->getError());
}
$registerStatus = $this->services->bstRegister($account, $password, $type, 'h5', $request['school_id'], $teacher_name,$request['class_id']);
if ($registerStatus) {
return app('json')->success(410013);
}
return app('json')->fail(410014);
}
/**
* 老师注册
*/
@ -298,6 +348,7 @@ class LoginController
],
true
);
try {
validate(RegisterValidates::class)->scene('TeacherRegister')->check(
['account' => $account, 'password' => $password, 'code' => $code, 'teacher_name' => $teacher_name]
@ -305,8 +356,10 @@ class LoginController
$SchoolServices = app()->make(SchoolServices::class);
$schoolData = $SchoolServices->selectSchoolCodeData($code);
if ($schoolData === true) {
throw new ValidateException(410073);
//邀请码无效
// throw new ValidateException(410073);
}
// if ($schoolData['school_name'] != $school_name) {
// throw new ValidateException(500051);
@ -322,6 +375,71 @@ class LoginController
return app('json')->fail(410014);
}
private function parentsRegister2($request, $type)
{
[$account, $password, $code, $school_name, $student_name, $captcha] = $request->postMore(
[
['account', ''],
['password', '88888888'],
['code', ''],
['school_name', ''],
['student_name', ''],
['captcha', '']
],
true
);
try {
validate(RegisterValidates::class)->scene('ParentsRegister')->check(
['account' => $account, 'password' => $password, 'code' => $code, 'student_name' => $student_name]
);
$SchoolServices = app()->make(SchoolServices::class);
$schoolData = $SchoolServices->selectSchoolById($request['school_id']);
if ($schoolData === true) {
throw new ValidateException(100026);
}
// if ($schoolData['school_name'] != $school_name) {
// throw new ValidateException(500051);
// }
} catch (ValidateException $e) {
return app('json')->fail($e->getError());
}
$verifyCode = CacheService::get('code_' . $account);
if (!$verifyCode)
return app('json')->fail(410009);
$verifyCode = substr($verifyCode, 0, 6);
if ($verifyCode != $captcha)
return app('json')->fail(410010);
//校验学生
$c = User::where([
'is_del' => 0,
'real_name' => $request['student_name'],
'class_id' => $request['class_id'],
'school_id' => $request['school_id'],
])->find();
if (!$c) {
return app('json')->fail('学生姓名错误');
}
$registerStatus = $this->services->bstRegister(
$account,
$password,
$type,
'h5',
$schoolData['id'],
$request['real_name'],
$request['class_id']
);
if ($registerStatus) {
return app('json')->success(410013);
}
return app('json')->fail(410014);
}
/**
* 家长注册
*/
@ -346,11 +464,13 @@ class LoginController
$SchoolGradeClassServices = app()->make(SchoolGradeClassServices::class);
$classData = $SchoolGradeClassServices->selectClassCodeData($code);
if ($classData === true) {
//邀请码无效
throw new ValidateException(410073);
}
$SchoolServices = app()->make(SchoolServices::class);
$schoolData = $SchoolServices->selectSchoolById($classData['school_id']);
$schoolData = $SchoolServices->selectSchoolById($request['school_id']);
if ($schoolData === true) {
throw new ValidateException(100026);
}
@ -442,6 +562,7 @@ class LoginController
}
return app('json')->fail(410014);
}
/**
* 密码修改
* @param Request $request

@ -2,21 +2,29 @@
namespace app\api\controller\v1\complaint;
use app\adminapi\controller\AuthController;
use app\jobs\OrderExpressJob;
use app\model\user\User;
use app\Request;
use app\services\user\LoginServices;
use app\services\crud\UserComplaintServices;
use crmeb\services\FileService;
use crmeb\services\SpreadsheetExcelService;
use mysql_xdevapi\Exception;
use think\exception\ValidateException;
use app\model\activity\advance\student;
use PhpOffice\PhpSpreadsheet\IOFactory;
use think\facade\Db;
class ComplaintController
class ComplaintController extends AuthController
{
protected $services = NUll;
public function __construct(UserComplaintServices $services)
{
$this->services = $services;
}
/**
@ -42,41 +50,122 @@ class ComplaintController
public function addComplaint(Request $request)
{
$data = $request->post();
//解析excel
//wmc解析excel
if (!empty($data['type']) && $data['type'] == 1) {
$uploadDir = 'uploadsFile/';
if (!is_dir($uploadDir)) {
mkdir($uploadDir, 0777, true);
}
$tempName = $_FILES['file']['tmp_name'];
$targetName = $uploadDir . basename($_FILES['file']['name']);
$fileExtension = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION);
if ($fileExtension != 'xlsx') {
return 1;
}
// 将临时文件移动到目标位置
if (move_uploaded_file($tempName, $targetName)) {
$ff = 'https://' . $_SERVER['HTTP_HOST'] . '/' . $targetName;
$content = file_get_contents($ff);
$array = explode(PHP_EOL, $content);
$length = count($array);
foreach ($array as $k => $v) {
if ($k != 0 && $k != $length) {
if (preg_match('/(.*?)(\d+)(.*)/', $v, $matches)) {
$beforeNumber = $matches[1]; // 第一个数字之前的字符
$number = $matches[2]; // 第一个数字
//插入数据
$f = public_path() . $targetName;
$inputFileType = IOFactory::identify($f);
$reader = IOFactory::createReader($inputFileType);
$spreadSheet = $reader->load($f);
//获取第几张数据表,默认从0开始
$sheet = $spreadSheet->getSheet(0);
//获取最大行数
$rows = $sheet->getHighestRow();
//获取最大列数
$cols = $sheet->getHighestColumn();
//获取全量数据集,返回数组形式数据
$dataArr = $sheet->rangeToArray('A1:' . $cols . $rows);
Db::startTrans();
$user = $request->user()->toArray()['uid'];
$t = User::where('uid',$user)->find();
$school_id = $t['school_id'];
$classid = $t['class_id'];
foreach ($dataArr as $k => $v) {
if ($k != 0) {
$data2['account'] = $v[1];
$data2['pwd'] = md5((string)'qq111111');
$data2['phone'] = $v[1];
$data2['group_id'] = 4;
$data2['school_id'] = $school_id;
$data2['bind_user_id'] = 0;
$data2['class_id'] = $classid;
$data2['real_name'] = $v[0];
$data2['birthday'] = 0;
$data2['card_id'] = '';
$data2['mark'] = '';
$data2['addres'] = '';
$data2['user_type'] = 'h5';
$data2['add_time'] = time();
$data2['add_ip'] = app('request')->ip();
$data2['last_time'] = time();
$data2['last_ip'] = app('request')->ip();
$data2['nickname'] = substr_replace($v[1], '****', 3, 4);
$data2['avatar'] = sys_config('h5_avatar');
$data2['status'] = 1;
$registerStatus = User::insert($data2);
if (!$registerStatus) {
Db::rollback();
return 1;
}
}
}
// $objPHPExcel = \PhpOffice\PhpSpreadsheet\IOFactory::load($ff);
Db::commit();
return 2;
}
return app('json')->fail('文件上传失败');
return 1;
}
//绑定亲属
if (!empty($data['type']) && $data['type'] == 2) {
$c = User::where([
'phone'=>$data['phone'],
'is_del'=>0
])->find();
if($c){
return app('json')->fail('号码已被注册');
}
$user = $request->user()->toArray()['uid'];
$t = User::where('uid',$user)->find();
$school_id = $t['school_id'];
$classid = $t['class_id'];
$data2['account'] = $data['phone'];
$data2['pwd'] = md5((string)'qq111111');
$data2['phone'] = $data['phone'];
$data2['group_id'] = 3;
$data2['school_id'] = $school_id;
$data2['bind_user_id'] = 0;
$data2['class_id'] = $classid;
$data2['real_name'] = $t['nickname'].'的亲属';
$data2['birthday'] = 0;
$data2['card_id'] = '';
$data2['mark'] = '';
$data2['addres'] = '';
$data2['user_type'] = 'h5';
$data2['add_time'] = time();
$data2['add_ip'] = app('request')->ip();
$data2['last_time'] = time();
$data2['last_ip'] = app('request')->ip();
$data2['nickname'] = substr_replace($data['phone'], '****', 3, 4);
$data2['avatar'] = sys_config('h5_avatar');
$data2['status'] = 1;
$registerStatus = User::insert($data2);
if($registerStatus){
return app('json')->success('成功');
}
return app('json')->fail('失败');
}
if (empty($data['content'])) {
return app('json')->fail(100100);
}
@ -95,7 +184,6 @@ class ComplaintController
}
$user = $request->user()->toArray();
$data['school_id'] = $user['school_id'];
$data['user_id'] = $user['uid'];
$data['user_name'] = $user['real_name'];

@ -10,6 +10,7 @@
// +----------------------------------------------------------------------
namespace app\api\controller\v1\publics;
use app\adminapi\controller\crud\School;
use app\services\article\ArticleCategoryServices;
use app\services\article\ArticleServices;
use crmeb\services\CacheService;
@ -34,6 +35,19 @@ class ArticleCategoryController
*/
public function lst()
{
//获取学校下的班级
if(!empty($_GET['type']) && $_GET['type'] == 'class'){
$class = \app\model\crud\SchoolGradeClass::where([
'is_del' => 0,
'school_id' => $_GET['school_id'],
])->select();
return app('json')->success([
'class'=>$class
]);
die;
}
$cateInfo = CacheService::remember('ARTICLE_CATEGORY', function () {
$cateInfo = $this->services->getArticleCategory();
// array_unshift($cateInfo, ['id' => 0, 'title' => '热门']);
@ -46,10 +60,18 @@ class ArticleCategoryController
$SchoolServices = app()->make(ArticleServices::class);
$list = $SchoolServices->getXwList();
$sc = \app\model\crud\School::where(['is_del' => 0])->select();
$class = \app\model\crud\SchoolGradeClass::where([
'is_del' => 0,
'school_id' => $sc[0]['id'],
])->select();
return app('json')->success([
'cateInfo' => $cateInfo,
'newsList' => $list,
'school'=>$sc,
'class'=>$class
]);
}
}

@ -303,6 +303,7 @@ class LoginServices extends BaseServices
}
}
/**
* 重置密码
* @param $account

@ -956,12 +956,12 @@ class FileService
{
if (!$filePath) return false;
$pathInfo = pathinfo($filePath, PATHINFO_EXTENSION);
if (!$pathInfo || $pathInfo != "xlsx") throw new AdminException(400728);
//加载读取模型
$readModel = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($suffix);
// 创建读操作
// 打开文件 载入excel表格
try {
$spreadsheet = $readModel->load($filePath);
$sheet = $spreadsheet->getActiveSheet();
@ -998,9 +998,19 @@ class FileService
];
}
}
if ($type == 'wmc') {
$t1 = $this->objToStr($sheet->getCellByColumnAndRow(1, $i)->getValue()) ?? '';
$t2 = $this->objToStr($sheet->getCellByColumnAndRow(2, $i)->getValue());
if ($t2) {
$data[] = [
'key' => $t1,
'value' => $t2
];
}
}
}
return $data;
} catch (\Exception $e) {
throw new AdminException($e->getMessage());
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save