From 525d204e357f8e4ed2f401fc8e3a77ff8671722d Mon Sep 17 00:00:00 2001
From: 15090180611 <215509543@qq.com>
Date: Thu, 19 Dec 2024 17:30:50 +0800
Subject: [PATCH] =?UTF-8?q?=E9=99=84=E4=BB=B6=E4=B8=8A=E4=BC=A0=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=E7=94=A8=E6=88=B7=E5=B1=9E=E6=80=A7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../admin/controller/general/Attachment.php | 13 +-
.../controller/school/classes/ClassesLib.php | 7 +-
application/admin/controller/user/User.php | 6 +-
.../admin/lang/zh-cn/general/attachment.php | 6 +-
application/api/controller/Index.php | 10 +-
application/common/library/Sqlscript.php | 124 ++++++++++++++++++
application/common/model/Attachment.php | 8 +-
.../common/model/ManystoreAttachment.php | 8 +-
application/common/model/User.php | 10 +-
.../common/model/dyqc/ManystoreShop.php | 10 +-
.../model/school/classes/ClassesLib.php | 19 +++
.../controller/general/Attachment.php | 11 +-
.../manystore/controller/user/User.php | 7 +-
.../lang/zh-cn/general/attachment.php | 6 +-
.../assets/js/backend/general/attachment.js | 11 +-
public/assets/js/backend/school/message.js | 4 +-
public/assets/js/backend/user/user.js | 23 +++-
.../assets/js/manystore/general/attachment.js | 8 +-
18 files changed, 259 insertions(+), 32 deletions(-)
diff --git a/application/admin/controller/general/Attachment.php b/application/admin/controller/general/Attachment.php
index e3c1b9b..b8f233c 100644
--- a/application/admin/controller/general/Attachment.php
+++ b/application/admin/controller/general/Attachment.php
@@ -59,7 +59,7 @@ class Attachment extends Backend
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
- $list = $this->model
+ $list = $this->model->with(["user"])
->where($mimetypeQuery)
->where($where)
->whereRaw("`filename` NOT REGEXP '^[0-9A-Fa-f]{32}'")
@@ -67,12 +67,19 @@ class Attachment extends Backend
->paginate($limit);
// var_dump($this->model->getLastSql());
+ foreach ($list as $row) {
+ $row->getRelation('user')->visible(['nickname', 'realname', 'mobile', 'avatar']);
+
+ }
+ $rows = $list->items();
+
+
$cdnurl = preg_replace("/\/(\w+)\.php$/i", '', $this->request->root());
- foreach ($list as $k => &$v) {
+ foreach ($rows as $k => &$v) {
$v['fullurl'] = ($v['storage'] == 'local' ? $cdnurl : $this->view->config['upload']['cdnurl']) . $v['url'];
}
unset($v);
- $result = array("total" => $list->total(), "rows" => $list->items());
+ $result = array("total" => $list->total(), "rows" => $rows);
return json($result);
}
diff --git a/application/admin/controller/school/classes/ClassesLib.php b/application/admin/controller/school/classes/ClassesLib.php
index 027f465..f155f10 100644
--- a/application/admin/controller/school/classes/ClassesLib.php
+++ b/application/admin/controller/school/classes/ClassesLib.php
@@ -706,7 +706,12 @@ class ClassesLib extends Backend
//主键值
$primaryvalue = $this->request->request("keyValue");
//搜索字段
- $searchfield = (array)$this->request->request("searchField/a");
+// $searchfield = (array)$this->request->request("searchField/a");
+
+ $searchfield = [
+ 'id','title', 'address', 'address_detail'
+ ];
+
//自定义搜索条件
$custom = (array)$this->request->request("custom/a");
//是否返回树形结构
diff --git a/application/admin/controller/user/User.php b/application/admin/controller/user/User.php
index 4c3f5b2..371aa0c 100644
--- a/application/admin/controller/user/User.php
+++ b/application/admin/controller/user/User.php
@@ -137,7 +137,11 @@ class User extends Backend
//主键值
$primaryvalue = $this->request->request("keyValue");
//搜索字段
- $searchfield = (array)$this->request->request("searchField/a");
+// $searchfield = (array)$this->request->request("searchField/a");
+ $searchfield = [
+ 'id','realname','nickname','mobile'
+ ];
+
//自定义搜索条件
$custom = (array)$this->request->request("custom/a");
//是否返回树形结构
diff --git a/application/admin/lang/zh-cn/general/attachment.php b/application/admin/lang/zh-cn/general/attachment.php
index 1dc6cae..0ab9369 100644
--- a/application/admin/lang/zh-cn/general/attachment.php
+++ b/application/admin/lang/zh-cn/general/attachment.php
@@ -37,5 +37,9 @@ return [
'Please enter a new name' => '请输入新的类别名称',
'Please select category' => '请选择一个类别',
'Category not found' => '指定的类别未找到',
- 'Upload from editor' => '从编辑器上传'
+ 'Upload from editor' => '从编辑器上传',
+ 'User.nickname' => '上传用户昵称',
+ 'User.realname' => '上传用户真实姓名',
+ 'User.mobile' => '上传用户手机号',
+ 'User.avatar' => '上传用户头像',
];
diff --git a/application/api/controller/Index.php b/application/api/controller/Index.php
index d0c9f37..f7b84c2 100644
--- a/application/api/controller/Index.php
+++ b/application/api/controller/Index.php
@@ -21,15 +21,21 @@ class Index extends Api
/**
* 执行sql脚本
- *
+ * @ApiMethod(GET)
+ * @ApiParams(name = "page", type = "int",required=false,description = "页数")
+ * @ApiParams(name = "limit", type = "int",required=false,description = "每页条数")
*/
public function index()
{
+ $limit = $this->request->param('limit/d', 1000);
+ $page = $this->request->param('page/d', 1);
Db::startTrans();
try {
// $da = ServiceOrder::getCost("dgadasdasdsds12343","2024121214396382520","aaaaa",$param=[],true);
// var_dump($da);
- Sqlscript::importClasses(1,1000);
+// Sqlscript::deleteClasses(1,1000);
+ Sqlscript::importClasses($page,$limit);
+ Sqlscript::importUser($page,$limit);
Db::commit();
} catch (PDOException|\Exception $e) {
Db::rollback();
diff --git a/application/common/library/Sqlscript.php b/application/common/library/Sqlscript.php
index a1ee00d..622d876 100644
--- a/application/common/library/Sqlscript.php
+++ b/application/common/library/Sqlscript.php
@@ -6,6 +6,10 @@ use app\common\model\school\Area;
use app\common\model\school\classes\Cate;
use app\common\model\school\classes\ClassesLib;
use app\common\model\school\classes\ClassesSpec;
+use app\common\model\school\classes\Evaluate;
+use app\common\model\school\classes\Order;
+use app\common\model\school\classes\order\OrderDetail;
+use app\common\model\school\classes\order\ServiceOrder;
use app\common\model\school\classes\Type;
use app\common\model\school\classes\VirtualHead;
use app\common\model\school\classes\VirtualUser;
@@ -85,6 +89,12 @@ $address_type = "2";
$v["start_time"] = substr($v["start_time"],0,10);
$v["end_time"] = substr($v["end_time"],0,10);
+
+ //如果是非过期课程则不添加
+ if($v["end_time"] >= time()){
+ continue;
+ }
+
$spec = [
"classes_lib_id"=>0,
"name"=>"单课时默认课时",
@@ -121,4 +131,118 @@ $address_type = "2";
+ public static function deleteClasses($page=1,$limit=1000){
+ $kechengs = Db::table("kecheng")
+ ->page($page,$limit)->select();
+
+ //默认机构id
+ $manystore_id = 1;
+ $shop_id = 1;
+ $user_id = 72;
+ $teacher_id = 15;
+ foreach ($kechengs as $k=>$v){
+ $classes_cate_ids = Cate::where( "name",$v["gongyi"])->value("id");
+ if(!$classes_cate_ids)$classes_cate_ids="";
+ $classes_label_ids = "";
+ $classes_type = Type::where( "name",$v["kecheng_type"])->value("id");
+ $add_type = "2";
+ $add_id = 0;
+ $title = $v["name"];
+ $headimage = $v["img"];
+ if(!$headimage)continue;
+ $images = Db::table("kecheng_img")->where("ke_id",$v["id"])->column("path");
+ $images = implode(",",$images);
+ $type = "in";
+ $classes_num = 1;
+ $address_type = "2";
+// "address_city": "河南省/洛阳市",
+// "province": "河南省",
+// "city": "洛阳市",
+// "area": null,
+// "province_code": 410000,
+// "city_code": 410300,
+// "area_code": 0
+ $address_city = "河南省/洛阳市"."/".$v["district"];
+ $address = $v["district"];
+ $address_detail = $v["shangkedidian"];
+ $province = 410000;
+ $city = 410300;
+ $district = Area::where( "name","like","%".$v["district"]."%")
+ ->where("level",3)
+ ->where("pid",$city)
+ ->value("id");
+ $longitude = $v["longitude"];
+ $latitude = $v["latitude"];
+ //html解码
+ $content = html_entity_decode($v["blurb"]);
+ $notice = html_entity_decode($v["experience"]);
+ $price = 0;
+ $status = "1";
+ $weigh = 0;
+ $recommend = ''.($v["por"] ?:0);
+ $hot = ''.($v["hot"] ?:0);
+ $new = ''.($v["top"] ?:0);
+ $auth_status = 1;
+ $feel = "1";
+ //如果不存在开始和结束时间
+ //随机生成个至少过去一个月的开始和结束时间, 结束时间至少过去一个月
+ if(!$v["start_time"]||!$v["end_time"]){
+ $v["start_time"] = time()-rand(2592000,2592000*10);
+ $v["end_time"] = rand($v["start_time"]+24536,$v["start_time"] + time()-$v["start_time"]);
+ }
+
+
+
+
+ //开始时间和结束时间如果是毫秒级时间戳,截取成秒级
+ $v["start_time"] = substr($v["start_time"],0,10);
+ $v["end_time"] = substr($v["end_time"],0,10);
+
+
+ $classes_lib = ClassesLib::where("title",$title)->find();
+ if($classes_lib){
+ ClassesLib::deleteAllByClassesId($classes_lib["id"]);
+ }
+ }
+ }
+
+ public static function importUser($page=1,$limit=1000){
+ $userwxs = Db::table("userwx")
+ ->page($page,$limit)->select();
+
+ //默认机构id
+ $manystore_id = 1;
+ $shop_id = 1;
+ $user_id = 72;
+ $teacher_id = 15;
+ foreach ($userwxs as $k=>$userwx){
+ $nickname = $userwx["user"] ?: $userwx["name"];
+ $mobile = $userwx["phone"];
+ //创建用户
+ $user = \app\common\model\User::where("mobile",$mobile)->find();
+ //检测更新教练下单学员账号创建状态 2022/8/27 new
+ if(!$user)$user = (new \app\common\model\User)->addUserByMobile($mobile,$nickname,false);
+ //更新附加信息
+ $user['nickname'] = $userwx["name"];
+ $user['realname'] = $userwx["user"];
+ if(!$userwx['sex'] || $userwx['sex'] == "男" || $userwx['sex'] == "1"){
+ $user['gender'] = 1;
+ }else{
+ $user['gender'] = 0;
+ }
+
+ $user['avatar'] = $userwx['head_img'] ?: "/old/static/common/images/tou2.png";
+ $user['birthday'] = $userwx['birthday'];
+ $user['work'] = $userwx['career'];
+ $user['createtime'] = strtotime($userwx["uptime"]);
+ $user['updatetime'] = strtotime($userwx["uptime"]);
+ $user->save();
+
+
+ }
+
+
+ }
+
+
}
\ No newline at end of file
diff --git a/application/common/model/Attachment.php b/application/common/model/Attachment.php
index 67f7178..cf05cbd 100644
--- a/application/common/model/Attachment.php
+++ b/application/common/model/Attachment.php
@@ -4,7 +4,7 @@ namespace app\common\model;
use think\Model;
-class Attachment extends Model
+class Attachment extends BaseModel
{
// 开启自动写入时间戳字段
@@ -95,4 +95,10 @@ class Attachment extends Model
$data['unclassed'] = __('Unclassed');
return $data;
}
+
+
+ public function user()
+ {
+ return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
}
diff --git a/application/common/model/ManystoreAttachment.php b/application/common/model/ManystoreAttachment.php
index aeec34b..51de800 100644
--- a/application/common/model/ManystoreAttachment.php
+++ b/application/common/model/ManystoreAttachment.php
@@ -4,7 +4,7 @@ namespace app\common\model;
use think\Model;
-class ManystoreAttachment extends Model
+class ManystoreAttachment extends BaseModel
{
// 开启自动写入时间戳字段
@@ -62,4 +62,10 @@ class ManystoreAttachment extends Model
}
});
}
+
+
+ public function user()
+ {
+ return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
+ }
}
diff --git a/application/common/model/User.php b/application/common/model/User.php
index e7d70c9..924ad1b 100644
--- a/application/common/model/User.php
+++ b/application/common/model/User.php
@@ -260,12 +260,12 @@ class User extends BaseModel
* @param $nickname
*/
public function addUserByMobile($mobile,$nickname,$check=true){
+ //去除空格
+ $nickname = trim($nickname);
+ $mobile = trim($mobile);
+ if(!is_numeric($mobile))throw new \Exception("不是合法手机号!");
+ if(strlen($mobile)!=11)throw new \Exception("请输入11位手机号!");
if($check){
- //去除空格
- $nickname = trim($nickname);
- $mobile = trim($mobile);
- if(!is_numeric($mobile))throw new \Exception("不是合法手机号!");
- if(strlen($mobile)!=11)throw new \Exception("请输入11位手机号!");
if (!preg_match("/[\x7f-\xff]/", $nickname)) throw new \Exception("名称必须是汉字,请去除空格和其他特殊符号!");
preg_match_all("/[\x{4e00}-\x{9fa5}]/u","$nickname",$result);
if(!$result || join('',$result[0])!=$nickname)throw new \Exception("名称必须是汉字,请去除空格和其他特殊符号!");
diff --git a/application/common/model/dyqc/ManystoreShop.php b/application/common/model/dyqc/ManystoreShop.php
index b223e74..32a770d 100644
--- a/application/common/model/dyqc/ManystoreShop.php
+++ b/application/common/model/dyqc/ManystoreShop.php
@@ -219,12 +219,12 @@ class ManystoreShop extends BaseModel
必要展示信息为:
1:地址信息:包括详细地址、所在城市、所在省、所在市、所在县、经纬度
- 2:店铺名称
- 3:店铺logo
- 4:店铺封面图
- 5:店铺环境照
+ 2:申请人姓名|机构名称
+ 3:logo
+ 4:封面图
+ 5:环境图片
6:服务电话
- 7:店铺详情
+ 7:详情
请您确保上述信息均已完善后才能正常上架课程。
若已完善请您刷新页面。
diff --git a/application/common/model/school/classes/ClassesLib.php b/application/common/model/school/classes/ClassesLib.php
index ecdc403..de92900 100644
--- a/application/common/model/school/classes/ClassesLib.php
+++ b/application/common/model/school/classes/ClassesLib.php
@@ -10,6 +10,8 @@ use app\common\model\manystore\Shop;
use app\common\model\manystore\UserAuth;
use app\common\model\school\Area;
use app\common\model\school\classes\lib\Spec;
+use app\common\model\school\classes\order\OrderDetail;
+use app\common\model\school\classes\order\ServiceOrder;
use app\common\model\User;
use app\manystore\model\Manystore;
use think\Model;
@@ -1816,6 +1818,23 @@ $user_unpaid_order = $user_paid_order =null;
}
+ public static function deleteAllByClassesId($classesId){
+ $classes_lib = ClassesLib::where("id",$classesId)->find();
+ if($classes_lib){
+ Order::where(array('classes_lib_id'=>$classes_lib['id']))->delete();
+ OrderDetail::where(array('classes_lib_id'=>$classes_lib['id']))->delete();
+ \app\admin\model\school\classes\hour\Order::where(array('classes_lib_id'=>$classes_lib['id']))->delete();
+ ServiceOrder::where(array('classes_lib_id'=>$classes_lib['id']))->delete();
+ Evaluate::where(array('classes_lib_id'=>$classes_lib['id']))->delete();
+ $specs = $classes_lib->specs;
+ foreach ($specs as $spec){
+ $spec->delete();
+ }
+ $classes_lib->delete();
+
+ }
+ }
+
}
diff --git a/application/manystore/controller/general/Attachment.php b/application/manystore/controller/general/Attachment.php
index 2881441..2ced2f6 100644
--- a/application/manystore/controller/general/Attachment.php
+++ b/application/manystore/controller/general/Attachment.php
@@ -60,19 +60,24 @@ class Attachment extends ManystoreBase
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
- $list = $this->model
+ $list = $this->model->with(["user"])
->where($mimetypeQuery)
->whereRaw("`filename` NOT REGEXP '^[0-9A-Fa-f]{32}'")
->where($where)
->order($sort, $order)
->paginate($limit);
+ foreach ($list as $row) {
+ $row->getRelation('user')->visible(['nickname', 'realname', 'mobile', 'avatar']);
+
+ }
+ $rows = $list->items();
$cdnurl = preg_replace("/\/(\w+)\.php$/i", '', $this->request->root());
- foreach ($list as $k => &$v) {
+ foreach ($rows as $k => &$v) {
$v['fullurl'] = ($v['storage'] == 'local' ? $cdnurl : $this->view->config['upload']['cdnurl']) . $v['url'];
}
unset($v);
- $result = array("total" => $list->total(), "rows" => $list->items());
+ $result = array("total" => $list->total(), "rows" => $rows);
return json($result);
}
diff --git a/application/manystore/controller/user/User.php b/application/manystore/controller/user/User.php
index 789cb25..41282b7 100644
--- a/application/manystore/controller/user/User.php
+++ b/application/manystore/controller/user/User.php
@@ -105,7 +105,12 @@ class User extends ManystoreBase
//主键值
$primaryvalue = $this->request->request("keyValue");
//搜索字段
- $searchfield = (array)$this->request->request("searchField/a");
+// $searchfield = (array)$this->request->request("searchField/a");
+
+ $searchfield = [
+ 'id','realname', 'username', 'nickname', 'mobile'
+ ];
+
//自定义搜索条件
$custom = (array)$this->request->request("custom/a");
//是否返回树形结构
diff --git a/application/manystore/lang/zh-cn/general/attachment.php b/application/manystore/lang/zh-cn/general/attachment.php
index 1dc6cae..0ab9369 100644
--- a/application/manystore/lang/zh-cn/general/attachment.php
+++ b/application/manystore/lang/zh-cn/general/attachment.php
@@ -37,5 +37,9 @@ return [
'Please enter a new name' => '请输入新的类别名称',
'Please select category' => '请选择一个类别',
'Category not found' => '指定的类别未找到',
- 'Upload from editor' => '从编辑器上传'
+ 'Upload from editor' => '从编辑器上传',
+ 'User.nickname' => '上传用户昵称',
+ 'User.realname' => '上传用户真实姓名',
+ 'User.mobile' => '上传用户手机号',
+ 'User.avatar' => '上传用户头像',
];
diff --git a/public/assets/js/backend/general/attachment.js b/public/assets/js/backend/general/attachment.js
index 2f7b376..f5522c6 100644
--- a/public/assets/js/backend/general/attachment.js
+++ b/public/assets/js/backend/general/attachment.js
@@ -25,8 +25,8 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
{field: 'state', checkbox: true},
{field: 'id', title: __('Id')},
{field: 'category', title: __('Category'), operate: 'in', formatter: Table.api.formatter.label, searchList: Config.categoryList},
- {field: 'admin_id', title: __('Admin_id'), visible: false, addClass: "selectpage", extend: "data-source='auth/admin/index' data-field='nickname'"},
- {field: 'user_id', title: __('User_id'), visible: false, addClass: "selectpage", extend: "data-source='user/user/index' data-field='nickname'"},
+ {field: 'admin_id', title: __('Admin_id'), addClass: "selectpage", extend: "data-source='auth/admin/index' data-field='nickname'"},
+ {field: 'user_id', title: __('User_id'), addClass: "selectpage", extend: "data-source='user/user/index' data-field='nickname'"},
{field: 'preview', title: __('Preview'), formatter: Controller.api.formatter.thumb, operate: false},
{field: 'url', title: __('Url'), formatter: Controller.api.formatter.url, visible: false},
{field: 'filename', title: __('Filename'), sortable: true, formatter: Controller.api.formatter.filename, operate: 'like'},
@@ -37,6 +37,13 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
return (size / Math.pow(1024, i)).toFixed(i < 2 ? 0 : 2) * 1 + ' ' + ['B', 'KB', 'MB', 'GB', 'TB'][i];
}
},
+ {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
+ {field: 'user.realname', title: __('User.realname'),visible:false, operate: 'LIKE'},
+ {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'},
+ {field: 'user.avatar', title: __('User.avatar'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
+
+
+
{field: 'imagewidth', title: __('Imagewidth'), sortable: true},
{field: 'imageheight', title: __('Imageheight'), sortable: true},
{field: 'imagetype', title: __('Imagetype'), sortable: true, formatter: Table.api.formatter.search, operate: 'like'},
diff --git a/public/assets/js/backend/school/message.js b/public/assets/js/backend/school/message.js
index 0f5efb7..ee16b76 100644
--- a/public/assets/js/backend/school/message.js
+++ b/public/assets/js/backend/school/message.js
@@ -33,9 +33,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'messageevent.logo_image', title: __('Logo_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'type', title: __('Type'), searchList: {"1":__('Type 1'),"2":__('Type 2')}, formatter: Table.api.formatter.normal},
- {field: 'status', title: __('Status'), searchList: {"system":__('Status system'),"classes":__('Status classes'),"order":__('Status order')}, formatter: Table.api.formatter.status},
+ {field: 'status', title: __('Status'), searchList: {"system":__('Status system'),"classes":__('Status classes'),"order":__('Status order')}, formatter: Table.api.formatter.status},
{field: 'mini_type', title: __('Mini_type'), searchList: {"order_notice":__('Mini_type order_notice'),"classes_auth":__('Mini_type classes_auth'),"classes_apply":__('Mini_type classes_apply'),"shop_apply":__('Mini_type shop_apply'),"classes_order_notice":__('Mini_type classes_order_notice'),"user_auth":__('Mini_type user_auth'),"aftercare":__('Mini_type aftercare'),"other":__('Mini_type other')}, formatter: Table.api.formatter.normal},
- {field: 'event', title: __('Event'),visible:false, operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {field: 'event', title: __('Event'),visible:false, operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'title', title: __('Title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'desc', title: __('Desc'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
diff --git a/public/assets/js/backend/user/user.js b/public/assets/js/backend/user/user.js
index 2e58b3f..13b71c1 100644
--- a/public/assets/js/backend/user/user.js
+++ b/public/assets/js/backend/user/user.js
@@ -55,7 +55,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
text: __('设置成机构认证'),
title: __('设置成机构认证'),
classname: 'btn btn-dialog',
- icon: 'fa fa-list',
+ icon: 'fa fa-bank',
dropdown : '更多',
url: manystore_url,
callback: function (data) {
@@ -70,7 +70,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
text: __('设置成机构授权'),
title: __('设置成机构授权'),
classname: 'btn btn-dialog',
- icon: 'fa fa-list',
+ icon: 'fa fa-bitbucket',
dropdown : '更多',
url: user_auth_url,
callback: function (data) {
@@ -181,6 +181,21 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
// return row.classes_evaluate_id;
// }
},
+ {
+ name: 'attachment',
+ text: __('查看用户上传图片'),
+ title: __('查看用户上传图片'),
+ classname: 'btn btn-dialog',
+ icon: 'fa fa-file-picture-o',
+ dropdown : '更多',
+ url: attachment_url,
+ callback: function (data) {
+
+ },
+ // visible: function (row) {
+ // return row.classes_evaluate_id;
+ // }
+ },
], events: Table.api.events.operate, formatter: Table.api.formatter.operate},
@@ -270,6 +285,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
return 'school/classes/evaluate/index?user_id='+row.id;
}
+ var attachment_url = function (row,dom) {
+ return 'general/attachment/index?user_id='+row.id;
+ }
+
return Controller;
});
\ No newline at end of file
diff --git a/public/assets/js/manystore/general/attachment.js b/public/assets/js/manystore/general/attachment.js
index 9bc3359..0369cd7 100644
--- a/public/assets/js/manystore/general/attachment.js
+++ b/public/assets/js/manystore/general/attachment.js
@@ -26,7 +26,7 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
{field: 'id', title: __('Id')},
{field: 'category', title: __('Category'), operate: 'in', formatter: Table.api.formatter.label, searchList: Config.categoryList},
- {field: 'user_id', title: __('User_id'), visible: false, addClass: "selectpage", extend: "data-source='user/user/index' data-field='nickname'"},
+ {field: 'user_id', title: __('User_id'), addClass: "selectpage", extend: "data-source='user/user/index' data-field='nickname'"},
{field: 'preview', title: __('Preview'), formatter: Controller.api.formatter.thumb, operate: false},
{field: 'url', title: __('Url'), formatter: Controller.api.formatter.url, visible: false},
@@ -38,6 +38,12 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
return (size / Math.pow(1024, i)).toFixed(i < 2 ? 0 : 2) * 1 + ' ' + ['B', 'KB', 'MB', 'GB', 'TB'][i];
}
},
+ {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
+ {field: 'user.realname', title: __('User.realname'),visible:false, operate: 'LIKE'},
+ {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'},
+ {field: 'user.avatar', title: __('User.avatar'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
+
+
{field: 'imagewidth', title: __('Imagewidth'), sortable: true},
{field: 'imageheight', title: __('Imageheight'), sortable: true},
{field: 'imagetype', title: __('Imagetype'), formatter: Table.api.formatter.search, operate: 'like'},