下单新增人员和备注
新增实名认证
This commit is contained in:
parent
6803e3aa59
commit
08df146841
232
application/admin/controller/cardocr/Card.php
Normal file
232
application/admin/controller/cardocr/Card.php
Normal file
@ -0,0 +1,232 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\controller\cardocr;
|
||||||
|
|
||||||
|
use app\common\controller\Backend;
|
||||||
|
use think\Config;
|
||||||
|
use think\Db;
|
||||||
|
use app\index\controller\Cardocr;
|
||||||
|
use addons\cardocr\library\traits\Check;
|
||||||
|
use think\Exception;
|
||||||
|
use think\exception\PDOException;
|
||||||
|
use think\exception\ValidateException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 身份证联网认证
|
||||||
|
*
|
||||||
|
* @icon fa fa-circle-o
|
||||||
|
*/
|
||||||
|
class Card extends Backend
|
||||||
|
{
|
||||||
|
//引入检查类
|
||||||
|
use Check;
|
||||||
|
/**
|
||||||
|
* Card模型对象
|
||||||
|
* @var \app\admin\model\cardocr\Card
|
||||||
|
*/
|
||||||
|
protected $model = null;
|
||||||
|
|
||||||
|
public function _initialize()
|
||||||
|
{
|
||||||
|
parent::_initialize();
|
||||||
|
$this->model = new \app\admin\model\cardocr\Card;
|
||||||
|
$this->view->assign("sexList", $this->model->getSexList());
|
||||||
|
$this->view->assign("statusList", $this->model->getStatusList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
|
||||||
|
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
|
||||||
|
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
//当前是否为关联查询
|
||||||
|
$this->relationSearch = true;
|
||||||
|
//设置过滤方法
|
||||||
|
$this->request->filter(['strip_tags']);
|
||||||
|
if ($this->request->isAjax()) {
|
||||||
|
//如果发送的来源是Selectpage,则转发到Selectpage
|
||||||
|
if ($this->request->request('keyField')) {
|
||||||
|
return $this->selectpage();
|
||||||
|
}
|
||||||
|
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
||||||
|
$total = $this->model
|
||||||
|
->with(['user'])
|
||||||
|
->where($where)
|
||||||
|
->order($sort, $order)
|
||||||
|
->count();
|
||||||
|
|
||||||
|
$list = $this->model
|
||||||
|
->with(['user'])
|
||||||
|
->where($where)
|
||||||
|
->order($sort, $order)
|
||||||
|
->limit($offset, $limit)
|
||||||
|
->select();
|
||||||
|
|
||||||
|
foreach ($list as $row) {
|
||||||
|
}
|
||||||
|
$list = collection($list)->toArray();
|
||||||
|
$result = array("total" => $total, "rows" => $list);
|
||||||
|
|
||||||
|
return json($result);
|
||||||
|
}
|
||||||
|
return $this->view->fetch();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*/
|
||||||
|
public function edit($ids = null)
|
||||||
|
{
|
||||||
|
$row = $this->model->get($ids);
|
||||||
|
if (!$row) {
|
||||||
|
$this->error(__('No Results were found'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->request->isPost()) {
|
||||||
|
$params = $this->request->post("row/a");
|
||||||
|
|
||||||
|
if ($params) {
|
||||||
|
// $params = $this->preExcludeFields($params);
|
||||||
|
$result = false;
|
||||||
|
|
||||||
|
//开启api验证
|
||||||
|
if ($params['isthroughapi'] == 1) {
|
||||||
|
$url = Config::get('upload.cdnurl');
|
||||||
|
$ImageUrl = cdnurl($params['positive_img'],true);
|
||||||
|
$ImagebackUrl = cdnurl($params['back_img'],true);
|
||||||
|
|
||||||
|
//orc获取正面信息
|
||||||
|
$front_data = $this->checkfront($ImageUrl);
|
||||||
|
$front_data = array_change_key_case($front_data, CASE_LOWER);
|
||||||
|
$params = $front_data + $params;
|
||||||
|
|
||||||
|
//orc获取反面信息
|
||||||
|
$back_data = $this->checkback($ImagebackUrl);
|
||||||
|
$back_data = array_change_key_case($back_data['backdata'], CASE_LOWER);
|
||||||
|
|
||||||
|
$params = array_filter($back_data) + $params;
|
||||||
|
|
||||||
|
$params_data = \addons\cardocr\library\Card::checkidcard($params['idnum'], $params['name']);
|
||||||
|
|
||||||
|
|
||||||
|
if ($params_data['Result'] != 0) {
|
||||||
|
$this->error(__('姓名与身份号码不一致', ''));
|
||||||
|
}
|
||||||
|
|
||||||
|
//修改审核通过
|
||||||
|
$params['status'] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
Db::startTrans();
|
||||||
|
try {
|
||||||
|
//是否采用模型验证
|
||||||
|
if ($this->modelValidate) {
|
||||||
|
$name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
|
||||||
|
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
|
||||||
|
$row->validateFailException(true)->validate($validate);
|
||||||
|
}
|
||||||
|
$result = $row->allowField(true)->save($params);
|
||||||
|
Db::commit();
|
||||||
|
} catch (ValidateException $e) {
|
||||||
|
Db::rollback();
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
Db::rollback();
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
} catch (Exception $e) {
|
||||||
|
Db::rollback();
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
}
|
||||||
|
if ($result !== false) {
|
||||||
|
$this->success();
|
||||||
|
} else {
|
||||||
|
$this->error(__('No rows were updated'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->error(__('Parameter %s can not be empty', ''));
|
||||||
|
}
|
||||||
|
$this->view->assign("row", $row);
|
||||||
|
return $this->view->fetch();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
if ($this->request->isPost()) {
|
||||||
|
$params = $this->request->post("row/a");
|
||||||
|
if ($params) {
|
||||||
|
// $params = $this->preExcludeFields($params);
|
||||||
|
|
||||||
|
if ($this->dataLimit && $this->dataLimitFieldAutoFill) {
|
||||||
|
$params[$this->dataLimitField] = $this->auth->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
//开启api验证
|
||||||
|
if ($params['isthroughapi'] == 1) {
|
||||||
|
$url = Config::get('upload.cdnurl');
|
||||||
|
$ImageUrl = cdnurl($params['positive_img'],true);
|
||||||
|
$ImagebackUrl = cdnurl($params['back_img'],true);
|
||||||
|
|
||||||
|
//orc获取正面信息
|
||||||
|
$front_data = $this->checkfront($ImageUrl);
|
||||||
|
$front_data = array_change_key_case($front_data, CASE_LOWER);
|
||||||
|
$params = $front_data + $params;
|
||||||
|
|
||||||
|
//orc获取反面信息
|
||||||
|
$back_data = $this->checkback($ImagebackUrl);
|
||||||
|
$back_data = array_change_key_case($back_data['backdata'], CASE_LOWER);
|
||||||
|
|
||||||
|
//修改审核通过
|
||||||
|
$params['status'] = 1;
|
||||||
|
$params = array_filter($back_data) + $params;
|
||||||
|
|
||||||
|
//调用api身份证实名验证
|
||||||
|
$params_data = \addons\cardocr\library\Card::checkidcard($params['idnum'], $params['name']);
|
||||||
|
|
||||||
|
|
||||||
|
if ($params_data['Result'] != 0) {
|
||||||
|
$this->error(__('姓名与身份号码不一致', ''));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = false;
|
||||||
|
Db::startTrans();
|
||||||
|
try {
|
||||||
|
//是否采用模型验证
|
||||||
|
if ($this->modelValidate) {
|
||||||
|
$name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
|
||||||
|
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate;
|
||||||
|
$this->model->validateFailException(true)->validate($validate);
|
||||||
|
}
|
||||||
|
$result = $this->model->allowField(true)->save($params);
|
||||||
|
Db::commit();
|
||||||
|
} catch (ValidateException $e) {
|
||||||
|
Db::rollback();
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
Db::rollback();
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
} catch (Exception $e) {
|
||||||
|
Db::rollback();
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
}
|
||||||
|
if ($result !== false) {
|
||||||
|
$this->success();
|
||||||
|
} else {
|
||||||
|
$this->error(__('No rows were inserted'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->error(__('Parameter %s can not be empty', ''));
|
||||||
|
}
|
||||||
|
return $this->view->fetch();
|
||||||
|
}
|
||||||
|
}
|
71
application/admin/controller/school/activity/Join.php
Normal file
71
application/admin/controller/school/activity/Join.php
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\controller\school\activity;
|
||||||
|
|
||||||
|
use app\common\controller\Backend;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户参加成员管理
|
||||||
|
*
|
||||||
|
* @icon fa fa-circle-o
|
||||||
|
*/
|
||||||
|
class Join extends Backend
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Join模型对象
|
||||||
|
* @var \app\admin\model\school\activity\Join
|
||||||
|
*/
|
||||||
|
protected $model = null;
|
||||||
|
|
||||||
|
public function _initialize()
|
||||||
|
{
|
||||||
|
parent::_initialize();
|
||||||
|
$this->model = new \app\admin\model\school\activity\Join;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
|
||||||
|
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
|
||||||
|
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
//当前是否为关联查询
|
||||||
|
$this->relationSearch = true;
|
||||||
|
//设置过滤方法
|
||||||
|
$this->request->filter(['strip_tags', 'trim']);
|
||||||
|
if ($this->request->isAjax()) {
|
||||||
|
//如果发送的来源是Selectpage,则转发到Selectpage
|
||||||
|
if ($this->request->request('keyField')) {
|
||||||
|
return $this->selectpage();
|
||||||
|
}
|
||||||
|
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
||||||
|
|
||||||
|
$list = $this->model
|
||||||
|
->with(['user'])
|
||||||
|
->where($where)
|
||||||
|
->order($sort, $order)
|
||||||
|
->paginate($limit);
|
||||||
|
|
||||||
|
foreach ($list as $row) {
|
||||||
|
|
||||||
|
$row->getRelation('user')->visible(['nickname','mobile','avatar']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = array("total" => $list->total(), "rows" => $list->items());
|
||||||
|
|
||||||
|
return json($result);
|
||||||
|
}
|
||||||
|
return $this->view->fetch();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
54
application/admin/lang/zh-cn/cardocr/card.php
Normal file
54
application/admin/lang/zh-cn/cardocr/card.php
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'User_id' => '会员ID',
|
||||||
|
'Name' => '姓名',
|
||||||
|
'Sex' => '性别',
|
||||||
|
'Nation' => '民族',
|
||||||
|
'Birth' => '生日',
|
||||||
|
'Address' => '身份证地址',
|
||||||
|
'Idnum' => '身份证id',
|
||||||
|
'Authority' => '发证机关',
|
||||||
|
'Validdatestart' => '有效期开始',
|
||||||
|
'Validdateend' => '有效期结束',
|
||||||
|
'Status' => '身份审核状态',
|
||||||
|
'Pass' => '通过',
|
||||||
|
'Down' => '拒绝',
|
||||||
|
'Unaudited' => '待审核',
|
||||||
|
'Positive_img' => '身份证正面',
|
||||||
|
'Back_img' => '身份证反面',
|
||||||
|
'IsthroughAPI' => '是否通过api审核',
|
||||||
|
'Memo' => '备注',
|
||||||
|
'Createtime' => '创建时间',
|
||||||
|
'Updatetime' => '更新时间',
|
||||||
|
'Publishtime' => '审核时间',
|
||||||
|
'User.id' => 'ID',
|
||||||
|
'User.group_id' => '组别ID',
|
||||||
|
'User.username' => '用户名',
|
||||||
|
'User.nickname' => '昵称',
|
||||||
|
'User.password' => '密码',
|
||||||
|
'User.salt' => '密码盐',
|
||||||
|
'User.email' => '电子邮箱',
|
||||||
|
'User.mobile' => '手机号',
|
||||||
|
'User.avatar' => '头像',
|
||||||
|
'User.level' => '等级',
|
||||||
|
'User.gender' => '性别',
|
||||||
|
'User.birthday' => '生日',
|
||||||
|
'User.bio' => '格言',
|
||||||
|
'User.money' => '余额',
|
||||||
|
'User.score' => '积分',
|
||||||
|
'User.ccoin' => 'C币',
|
||||||
|
'User.successions' => '连续登录天数',
|
||||||
|
'User.maxsuccessions' => '最大连续登录天数',
|
||||||
|
'User.prevtime' => '上次登录时间',
|
||||||
|
'User.logintime' => '登录时间',
|
||||||
|
'User.loginip' => '登录IP',
|
||||||
|
'User.loginfailure' => '失败次数',
|
||||||
|
'User.joinip' => '加入IP',
|
||||||
|
'User.jointime' => '加入时间',
|
||||||
|
'User.createtime' => '创建时间',
|
||||||
|
'User.updatetime' => '更新时间',
|
||||||
|
'User.token' => 'Token',
|
||||||
|
'User.status' => '状态',
|
||||||
|
'User.verification' => '验证'
|
||||||
|
];
|
12
application/admin/lang/zh-cn/school/activity/join.php
Normal file
12
application/admin/lang/zh-cn/school/activity/join.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'User_id' => '会员ID',
|
||||||
|
'Name' => '姓名',
|
||||||
|
'Idnum' => '身份证号',
|
||||||
|
'Createtime' => '创建时间',
|
||||||
|
'Updatetime' => '更新时间',
|
||||||
|
'User.nickname' => '昵称',
|
||||||
|
'User.mobile' => '手机号',
|
||||||
|
'User.avatar' => '头像'
|
||||||
|
];
|
64
application/admin/model/cardocr/Card.php
Normal file
64
application/admin/model/cardocr/Card.php
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\model\cardocr;
|
||||||
|
|
||||||
|
use think\Model;
|
||||||
|
|
||||||
|
class Card extends Model
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
// 表名
|
||||||
|
protected $name = 'cardocr';
|
||||||
|
|
||||||
|
// 自动写入时间戳字段
|
||||||
|
protected $autoWriteTimestamp = 'int';
|
||||||
|
|
||||||
|
// 定义时间戳字段名
|
||||||
|
protected $createTime = 'createtime';
|
||||||
|
protected $updateTime = 'updatetime';
|
||||||
|
protected $deleteTime = false;
|
||||||
|
|
||||||
|
// 追加属性
|
||||||
|
protected $append = [
|
||||||
|
'sex_text',
|
||||||
|
'publishtime_text'
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
public function getSexList()
|
||||||
|
{
|
||||||
|
return ['男' => __('男'), '女' => __('女'), '未知' => __('未知')];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getStatusList()
|
||||||
|
{
|
||||||
|
return ['0' => __('Down'), '1' => __('Pass'), '2' => __('Unaudited')];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getSexTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ? $value : (isset($data['sex']) ? $data['sex'] : '');
|
||||||
|
$list = $this->getSexList();
|
||||||
|
return isset($list[$value]) ? $list[$value] : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getPublishtimeTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ? $value : (isset($data['publishtime']) ? $data['publishtime'] : '');
|
||||||
|
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function setPublishtimeAttr($value)
|
||||||
|
{
|
||||||
|
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function user()
|
||||||
|
{
|
||||||
|
return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||||
|
}
|
||||||
|
}
|
44
application/admin/model/school/activity/Join.php
Normal file
44
application/admin/model/school/activity/Join.php
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\model\school\activity;
|
||||||
|
|
||||||
|
use think\Model;
|
||||||
|
|
||||||
|
|
||||||
|
class Join extends Model
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 表名
|
||||||
|
protected $name = 'school_activity_join';
|
||||||
|
|
||||||
|
// 自动写入时间戳字段
|
||||||
|
protected $autoWriteTimestamp = 'integer';
|
||||||
|
|
||||||
|
// 定义时间戳字段名
|
||||||
|
protected $createTime = 'createtime';
|
||||||
|
protected $updateTime = 'updatetime';
|
||||||
|
protected $deleteTime = false;
|
||||||
|
|
||||||
|
// 追加属性
|
||||||
|
protected $append = [
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function user()
|
||||||
|
{
|
||||||
|
return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||||
|
}
|
||||||
|
}
|
26
application/admin/validate/cardocr/Card.php
Normal file
26
application/admin/validate/cardocr/Card.php
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\validate\cardocr;
|
||||||
|
|
||||||
|
use think\Validate;
|
||||||
|
|
||||||
|
class Card extends Validate
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 验证规则
|
||||||
|
*/
|
||||||
|
protected $rule = [
|
||||||
|
];
|
||||||
|
/**
|
||||||
|
* 提示消息
|
||||||
|
*/
|
||||||
|
protected $message = [
|
||||||
|
];
|
||||||
|
/**
|
||||||
|
* 验证场景
|
||||||
|
*/
|
||||||
|
protected $scene = [
|
||||||
|
'add' => [],
|
||||||
|
'edit' => [],
|
||||||
|
];
|
||||||
|
}
|
27
application/admin/validate/school/activity/Join.php
Normal file
27
application/admin/validate/school/activity/Join.php
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\validate\school\activity;
|
||||||
|
|
||||||
|
use think\Validate;
|
||||||
|
|
||||||
|
class Join extends Validate
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 验证规则
|
||||||
|
*/
|
||||||
|
protected $rule = [
|
||||||
|
];
|
||||||
|
/**
|
||||||
|
* 提示消息
|
||||||
|
*/
|
||||||
|
protected $message = [
|
||||||
|
];
|
||||||
|
/**
|
||||||
|
* 验证场景
|
||||||
|
*/
|
||||||
|
protected $scene = [
|
||||||
|
'add' => [],
|
||||||
|
'edit' => [],
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
159
application/admin/view/cardocr/card/add.html
Normal file
159
application/admin/view/cardocr/card/add.html
Normal file
@ -0,0 +1,159 @@
|
|||||||
|
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||||
|
<div class="alert alert-info">
|
||||||
|
<strong>提示!</strong> 打开最下面的"通过api审核"按钮,只需选择"会员id",填写"姓名","身份证号码",上传身份正反面,提交后便可自动填写数据。
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-user_id" data-rule="required;remote({:url('/admin/cardocr/card/checkuseridavailable')})"
|
||||||
|
data-source="user/user/index" data-field="mobile" data-format-item="{id} - {nickname} - {mobile}" class="form-control selectpage"
|
||||||
|
name="row[user_id]" type="text" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-name" class="form-control" name="row[name]" type="text" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Sex')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<select id="c-sex" data-rule="required" class="form-control selectpicker" name="row[sex]">
|
||||||
|
{foreach name="sexList" item="vo"}
|
||||||
|
<option value="{$key}" {in name="key" value="未知" }selected{
|
||||||
|
/in}>{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Nation')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-nation" class="form-control" name="row[nation]" type="text" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Birth')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-birth" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
data-use-current="true" name="row[birth]" type="text" value="{:date('Y-m-d H:i:s')}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-address" class="form-control" name="row[address]" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Idnum')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-idnum"
|
||||||
|
data-rule="required;IDcard;remote({:url('/admin/cardocr/card/checkidcardavailable')})"
|
||||||
|
class="form-control" name="row[idnum]" type="text" value="" placeholder="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Authority')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-authority" class="form-control" name="row[authority]" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Validdatestart')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-validdatestart" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
data-use-current="true" name="row[validdatestart]" type="text" value="{:date('Y-m-d H:i:s')}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Validdateend')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-validdateend" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
data-use-current="true" name="row[validdateend]" type="text" value="{:date('Y-m-d H:i:s')}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<select id="c-status" data-rule="required" class="form-control selectpicker" name="row[status]">
|
||||||
|
{foreach name="statusList" item="vo"}
|
||||||
|
<option value="{$key}" {in name="key" value="2" }selected{
|
||||||
|
/in}>{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
<!--<input id="c-status" data-rule="required" class="form-control" name="row[status]" type="text" value="">-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Positive_img')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<div class="input-group">
|
||||||
|
<input id="c-positive_img" class="form-control" size="50" name="row[positive_img]" type="text">
|
||||||
|
<div class="input-group-addon no-border no-padding">
|
||||||
|
<span><button type="button" id="plupload-positive_img" class="btn btn-danger plupload"
|
||||||
|
data-input-id="c-positive_img" data-mimetype="image/jpeg,image/png,image/jpg"
|
||||||
|
data-maxsize="3M" data-multiple="false" data-preview-id="p-positive_img"><i
|
||||||
|
class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||||
|
<span><button type="button" id="fachoose-positive_img" class="btn btn-primary fachoose"
|
||||||
|
data-input-id="c-positive_img" data-mimetype="image/*" data-multiple="false"><i
|
||||||
|
class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||||
|
</div>
|
||||||
|
<span class="msg-box n-right" for="c-positive_img"></span>
|
||||||
|
</div>
|
||||||
|
<ul class="row list-inline plupload-preview" id="p-positive_img"></ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Back_img')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<div class="input-group">
|
||||||
|
<input id="c-back_img" class="form-control" size="50" name="row[back_img]" type="text">
|
||||||
|
<div class="input-group-addon no-border no-padding">
|
||||||
|
<span><button type="button" id="plupload-back_img" class="btn btn-danger plupload"
|
||||||
|
data-input-id="c-back_img" data-mimetype="image/jpeg,image/png,image/jpg"
|
||||||
|
data-multiple="false" data-maxsize="3M" data-preview-id="p-back_img"><i
|
||||||
|
class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||||
|
<span><button type="button" id="fachoose-back_img" class="btn btn-primary fachoose"
|
||||||
|
data-input-id="c-back_img" data-mimetype="image/*" data-multiple="false"><i
|
||||||
|
class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||||
|
</div>
|
||||||
|
<span class="msg-box n-right" for="c-back_img"></span>
|
||||||
|
</div>
|
||||||
|
<ul class="row list-inline plupload-preview" id="p-back_img"></ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Memo')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-memo" class="form-control" name="row[memo]" type="text" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Publishtime')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-publishtime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
data-use-current="true" name="row[publishtime]" type="text" value="{:date('Y-m-d H:i:s')}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('IsthroughAPI')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-isthroughapi" name="row[isthroughapi]" type="hidden" value="0">
|
||||||
|
<a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-isthroughapi"
|
||||||
|
data-yes="1" data-no="0">
|
||||||
|
<i class="fa fa-toggle-on text-success fa-flip-horizontal text-gray fa-2x"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group layer-footer">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
|
||||||
|
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
161
application/admin/view/cardocr/card/edit.html
Normal file
161
application/admin/view/cardocr/card/edit.html
Normal file
@ -0,0 +1,161 @@
|
|||||||
|
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||||
|
<div class="alert alert-info">
|
||||||
|
<strong>提示!</strong> 打开最下面的"通过api审核"按钮,可以获取身份证与图片是否一致。
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-user_id" data-rule="required" data-source="user/user/index"
|
||||||
|
data-field="mobile" data-format-item="{id} - {nickname} - {mobile}"
|
||||||
|
class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-name" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Sex')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<select id="c-sex" data-rule="required" class="form-control selectpicker" name="row[sex]">
|
||||||
|
{foreach name="sexList" item="vo"}
|
||||||
|
<option value="{$key}" {in name="key" value="$row.sex" }selected{
|
||||||
|
/in}>{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Nation')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-nation" class="form-control" name="row[nation]" type="text" value="{$row.nation|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Birth')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-birth" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
data-use-current="true" name="row[birth]" type="text" value="{$row.birth}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-address" class="form-control" name="row[address]" type="text"
|
||||||
|
value="{$row.address|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Idnum')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-idnum" data-rule="required" class="form-control" name="row[idnum]" type="text"
|
||||||
|
value="{$row.idnum|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Authority')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-authority" class="form-control" name="row[authority]" type="text"
|
||||||
|
value="{$row.authority|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Validdatestart')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-validdatestart" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
data-use-current="true" name="row[validdatestart]" type="text" value="{$row.validdatestart}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Validdateend')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-validdateend" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
data-use-current="true" name="row[validdateend]" type="text" value="{$row.validdateend}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<select id="c-status" data-rule="required" class="form-control selectpicker" name="row[status]">
|
||||||
|
{foreach name="statusList" item="vo"}
|
||||||
|
<option value="{$key}" {in name="key" value="$row.status" }selected{
|
||||||
|
/in}>{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
<!--<input id="c-status" data-rule="required" class="form-control" name="row[status]" type="text" value="{$row.status|htmlentities}">-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Positive_img')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<div class="input-group">
|
||||||
|
<input id="c-positive_img" class="form-control" size="50" name="row[positive_img]" type="text"
|
||||||
|
value="{$row.positive_img|htmlentities}">
|
||||||
|
<div class="input-group-addon no-border no-padding">
|
||||||
|
<span><button type="button" id="plupload-positive_img" class="btn btn-danger plupload"
|
||||||
|
data-input-id="c-positive_img" data-mimetype="image/jpeg,image/png,image/jpg"
|
||||||
|
data-multiple="false" data-preview-id="p-positive_img"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||||
|
<span><button type="button" id="fachoose-positive_img" class="btn btn-primary fachoose"
|
||||||
|
data-input-id="c-positive_img" data-mimetype="image/*" data-multiple="false"><i
|
||||||
|
class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||||
|
</div>
|
||||||
|
<span class="msg-box n-right" for="c-positive_img"></span>
|
||||||
|
</div>
|
||||||
|
<ul class="row list-inline plupload-preview" id="p-positive_img"></ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Back_img')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<div class="input-group">
|
||||||
|
<input id="c-back_img" class="form-control" size="50" name="row[back_img]" type="text"
|
||||||
|
value="{$row.back_img|htmlentities}">
|
||||||
|
<div class="input-group-addon no-border no-padding">
|
||||||
|
<span><button type="button" id="plupload-back_img" class="btn btn-danger plupload"
|
||||||
|
data-input-id="c-back_img" data-mimetype="image/jpeg,image/png,image/jpg"
|
||||||
|
data-multiple="false" data-preview-id="p-back_img"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||||
|
<span><button type="button" id="fachoose-back_img" class="btn btn-primary fachoose"
|
||||||
|
data-input-id="c-back_img" data-mimetype="image/*" data-multiple="false"><i
|
||||||
|
class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||||
|
</div>
|
||||||
|
<span class="msg-box n-right" for="c-back_img"></span>
|
||||||
|
</div>
|
||||||
|
<ul class="row list-inline plupload-preview" id="p-back_img"></ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Memo')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-memo" class="form-control" name="row[memo]" type="text" value="{$row.memo|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Publishtime')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-publishtime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
data-use-current="true" name="row[publishtime]" type="text"
|
||||||
|
value="{:$row.publishtime?datetime($row.publishtime):''}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('IsthroughAPI')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-isthroughapi" name="row[isthroughapi]" type="hidden" value="0">
|
||||||
|
<a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-isthroughapi"
|
||||||
|
data-yes="1" data-no="0">
|
||||||
|
<i class="fa fa-toggle-on text-success fa-flip-horizontal text-gray fa-2x"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group layer-footer">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
|
||||||
|
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
47
application/admin/view/cardocr/card/index.html
Normal file
47
application/admin/view/cardocr/card/index.html
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
<div class="panel panel-default panel-intro">
|
||||||
|
{:build_heading()}
|
||||||
|
|
||||||
|
<div class="panel-body">
|
||||||
|
<div id="myTabContent" class="tab-content">
|
||||||
|
<div class="tab-pane fade active in" id="one">
|
||||||
|
<div class="widget-body no-padding">
|
||||||
|
<div id="toolbar" class="toolbar">
|
||||||
|
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}"><i
|
||||||
|
class="fa fa-refresh"></i> </a>
|
||||||
|
<a href="javascript:;"
|
||||||
|
class="btn btn-success btn-add {:$auth->check('cardocr/card/add')?'':'hide'}"
|
||||||
|
title="{:__('Add')}"><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||||
|
<a href="javascript:;"
|
||||||
|
class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('cardocr/card/edit')?'':'hide'}"
|
||||||
|
title="{:__('Edit')}"><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||||
|
<a href="javascript:;"
|
||||||
|
class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('cardocr/card/del')?'':'hide'}"
|
||||||
|
title="{:__('Delete')}"><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="dropdown btn-group {:$auth->check('cardocr/card/multi')?'':'hide'}">
|
||||||
|
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled"
|
||||||
|
data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
|
||||||
|
<ul class="dropdown-menu text-left" role="menu">
|
||||||
|
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;"
|
||||||
|
data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a>
|
||||||
|
</li>
|
||||||
|
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;"
|
||||||
|
data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to
|
||||||
|
hidden')}</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||||
|
data-operate-edit="{:$auth->check('cardocr/card/edit')}"
|
||||||
|
data-operate-del="{:$auth->check('cardocr/card/del')}"
|
||||||
|
width="100%">
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
33
application/admin/view/school/activity/join/add.html
Normal file
33
application/admin/view/school/activity/join/add.html
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="mobile" data-format-item="{id} - {nickname} - {mobile}" class="form-control selectpage" name="row[user_id]" type="text" value="">
|
||||||
|
<!-- <span style="color: red">-->
|
||||||
|
|
||||||
|
<!-- (没找到用户则点击按钮创建用户后重新下拉框选用户)-->
|
||||||
|
<!-- <a data-url="user/user/changeuser" href="javascript:;" class="btn btn-success btn-changeuser {:$auth->check('user/user/changeuser')?'':'hide'}" title="根据手机号生成用户" ><i class="fa fa-plus"></i> 根据手机号生成用户</a>-->
|
||||||
|
|
||||||
|
<!-- </span>-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-name" class="form-control" name="row[name]" type="text" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Idnum')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-idnum" data-rule="required" class="form-control" name="row[idnum]" type="text" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group layer-footer">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
36
application/admin/view/school/activity/join/edit.html
Normal file
36
application/admin/view/school/activity/join/edit.html
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="mobile" data-format-item="{id} - {nickname} - {mobile}" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
|
||||||
|
|
||||||
|
<!-- <span style="color: red">-->
|
||||||
|
|
||||||
|
<!-- (没找到用户则点击按钮创建用户后重新下拉框选用户)-->
|
||||||
|
<!-- <a data-url="user/user/changeuser" href="javascript:;" class="btn btn-success btn-changeuser {:$auth->check('user/user/changeuser')?'':'hide'}" title="根据手机号生成用户" ><i class="fa fa-plus"></i> 根据手机号生成用户</a>-->
|
||||||
|
|
||||||
|
<!-- </span>-->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-name" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Idnum')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-idnum" data-rule="required" class="form-control" name="row[idnum]" type="text" value="{$row.idnum|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group layer-footer">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
29
application/admin/view/school/activity/join/index.html
Normal file
29
application/admin/view/school/activity/join/index.html
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<div class="panel panel-default panel-intro">
|
||||||
|
{:build_heading()}
|
||||||
|
|
||||||
|
<div class="panel-body">
|
||||||
|
<div id="myTabContent" class="tab-content">
|
||||||
|
<div class="tab-pane fade active in" id="one">
|
||||||
|
<div class="widget-body no-padding">
|
||||||
|
<div id="toolbar" class="toolbar">
|
||||||
|
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
||||||
|
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('school/activity/join/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||||
|
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('school/activity/join/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||||
|
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('school/activity/join/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||||
|
data-operate-edit="{:$auth->check('school/activity/join/edit')}"
|
||||||
|
data-operate-del="{:$auth->check('school/activity/join/del')}"
|
||||||
|
width="100%">
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -339,6 +339,7 @@ class User extends Api
|
|||||||
$data["settle_info"] = SettleLog::getUserSettleInfo($this->auth->id);
|
$data["settle_info"] = SettleLog::getUserSettleInfo($this->auth->id);
|
||||||
//活动信息
|
//活动信息
|
||||||
$data["activity_info"] = Activity::getActivityInfo($this->auth->id);
|
$data["activity_info"] = Activity::getActivityInfo($this->auth->id);
|
||||||
|
$data["realname_info"] = (new \app\common\model\cardocr\Card)->checkRealname($this->auth->id);
|
||||||
|
|
||||||
$this->success('调用成功',$data);
|
$this->success('调用成功',$data);
|
||||||
}
|
}
|
||||||
|
106
application/api/controller/school/RealName.php
Normal file
106
application/api/controller/school/RealName.php
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\api\controller\school;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实名认证接口
|
||||||
|
*/
|
||||||
|
class RealName extends Base
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
protected $noNeedLogin = [];
|
||||||
|
protected $noNeedRight = '*';
|
||||||
|
|
||||||
|
protected $model = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化操作
|
||||||
|
* @access protected
|
||||||
|
*/
|
||||||
|
protected function _initialize()
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->model = new \app\common\model\cardocr\Card();
|
||||||
|
parent::_initialize();
|
||||||
|
|
||||||
|
//判断登录用户是否是员工
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ApiTitle( 更新或保存实名认证信息)
|
||||||
|
* @ApiSummary(更新或保存实名认证信息)
|
||||||
|
* @ApiMethod(POST)
|
||||||
|
* @ApiParams(name = "name", type = "string",required=true,description = "姓名")
|
||||||
|
* @ApiParams(name = "idnum", type = "string",required=true,description = "身份证号")
|
||||||
|
* @ApiParams(name = "positive_img", type = "string",required=true,description = "身份证正面")
|
||||||
|
* @ApiParams(name = "back_img", type = "string",required=true,description = "身份证反面")
|
||||||
|
* @ApiReturn({
|
||||||
|
*
|
||||||
|
*})
|
||||||
|
*/
|
||||||
|
public function save()
|
||||||
|
{
|
||||||
|
$user_id = 0;
|
||||||
|
$user = $this->auth->getUser();//登录用户
|
||||||
|
if($user)$user_id = $user['id'];
|
||||||
|
$params =[];
|
||||||
|
$params["name"] = $this->request->param('name/s', ''); //页数
|
||||||
|
$params["idnum"] = $this->request->param('idnum/s', ''); //条数
|
||||||
|
$params["positive_img"] = $this->request->param('positive_img/s', ''); //搜索关键字
|
||||||
|
$params["back_img"] = $this->request->param('back_img/s', ''); //搜索关键字
|
||||||
|
$params["user_id"] = $user_id;
|
||||||
|
// $params = [];
|
||||||
|
//
|
||||||
|
// $params["auth_status"] = $this->request->get('auth_status/s', ''); //搜索关键字
|
||||||
|
|
||||||
|
// $activity_id = $this->request->get('activity_id/s', ''); //搜索关键字
|
||||||
|
//
|
||||||
|
// $has_evaluate = $this->request->get('has_evaluate/d', 0); //搜索关键字
|
||||||
|
// $type = $this->request->get('type/s', ''); //筛选学员和教练单
|
||||||
|
|
||||||
|
try{
|
||||||
|
//当前申请状态
|
||||||
|
$res = $this->model->add($params,true);
|
||||||
|
// if($user_id =='670153'){
|
||||||
|
// file_put_contents("ceshi66.txt",(new AppointmentOrder())->getLastSql());
|
||||||
|
// }
|
||||||
|
}catch (\Exception $e){
|
||||||
|
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
}
|
||||||
|
$this->success('认证成功', $res);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ApiTitle(实名认证信息查询)
|
||||||
|
* @ApiSummary(实名认证信息查询)
|
||||||
|
* @ApiMethod(GET)
|
||||||
|
* @ApiReturn({
|
||||||
|
*
|
||||||
|
*})
|
||||||
|
*/
|
||||||
|
public function info()
|
||||||
|
{
|
||||||
|
$user_id = 0;
|
||||||
|
$user = $this->auth->getUser();//登录用户
|
||||||
|
if($user)$user_id = $user['id'];
|
||||||
|
|
||||||
|
try{
|
||||||
|
//当前申请状态
|
||||||
|
$res = $this->model->checkRealname($user_id);
|
||||||
|
|
||||||
|
}catch (\Exception $e){
|
||||||
|
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
}
|
||||||
|
$this->success('查询成功', $res);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
192
application/api/controller/school/newactivity/ActivityJoin.php
Normal file
192
application/api/controller/school/newactivity/ActivityJoin.php
Normal file
@ -0,0 +1,192 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\api\controller\school\newactivity;
|
||||||
|
|
||||||
|
use app\api\controller\school\Base;
|
||||||
|
use app\common\model\school\activity\Join;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户参加成员管理
|
||||||
|
*/
|
||||||
|
class ActivityJoin extends Base
|
||||||
|
{
|
||||||
|
protected $noNeedLogin = [];
|
||||||
|
protected $noNeedRight = '*';
|
||||||
|
|
||||||
|
protected $model = null;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化操作
|
||||||
|
* @access protected
|
||||||
|
*/
|
||||||
|
protected function _initialize()
|
||||||
|
{
|
||||||
|
// $this->transactionCheck();
|
||||||
|
|
||||||
|
$this->model = new Join;
|
||||||
|
parent::_initialize();
|
||||||
|
|
||||||
|
|
||||||
|
// $this->setUrlLock();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ApiTitle( 成员列表接口)
|
||||||
|
* @ApiSummary(成员列表接口)
|
||||||
|
* @ApiMethod(GET)
|
||||||
|
* @ApiParams(name = "keywords", type = "string",required=false,description = "搜索关键字")
|
||||||
|
* @ApiParams(name = "page", type = "string",required=true,description = "页数")
|
||||||
|
* @ApiParams(name = "limit", type = "string",required=true,description = "条数")
|
||||||
|
*
|
||||||
|
* @ApiReturn({
|
||||||
|
*
|
||||||
|
*})
|
||||||
|
*/
|
||||||
|
public function people_list()
|
||||||
|
{
|
||||||
|
$user_id = 0;
|
||||||
|
$user = $this->auth->getUser();//登录用户
|
||||||
|
if($user)$user_id = $user['id'];
|
||||||
|
|
||||||
|
$params = [];
|
||||||
|
$params['user_id'] = $user_id;
|
||||||
|
$page = $this->request->get('page/d', 0); //页数
|
||||||
|
$limit = $this->request->get('limit/d', 0); //条数
|
||||||
|
$params["keywords"] = $this->request->get('keywords/s', ''); //搜索关键字
|
||||||
|
|
||||||
|
|
||||||
|
// $params["time"] = $this->request->get('time/s', ''); //时间
|
||||||
|
|
||||||
|
try{
|
||||||
|
//当前申请状态
|
||||||
|
$res = $this->model::joinList($page, $limit,$params);
|
||||||
|
// if($user_id =='670153'){
|
||||||
|
// file_put_contents("ceshi66.txt",(new AppointmentOrder())->getLastSql());
|
||||||
|
// }
|
||||||
|
}catch (\Exception $e){
|
||||||
|
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
}
|
||||||
|
$this->success('查询成功', $res);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ApiTitle( 成员详情)
|
||||||
|
* @ApiSummary(成员详情)
|
||||||
|
* @ApiMethod(GET)
|
||||||
|
* @ApiParams(name = "id", type = "int",required=true,description = "成员id")
|
||||||
|
* @ApiReturn({
|
||||||
|
*
|
||||||
|
*})
|
||||||
|
*/
|
||||||
|
public function detail(){
|
||||||
|
$id = $this->request->get('id/d','');
|
||||||
|
|
||||||
|
if(empty($id)){
|
||||||
|
$this->error(__('缺少必要参数'));
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$res = $this->model->detail($id);
|
||||||
|
} catch (\Exception $e){
|
||||||
|
// Log::log($e->getMessage());
|
||||||
|
$this->error($e->getMessage(),['errcode'=>$e->getCode()]);
|
||||||
|
}
|
||||||
|
$this->success('获取成功', ['detail' => $res]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除成员
|
||||||
|
*
|
||||||
|
* @ApiMethod (POST)
|
||||||
|
* @ApiParams (name="ids", type="string", required=true, description="要删除的ids")
|
||||||
|
*/
|
||||||
|
public function del()
|
||||||
|
{
|
||||||
|
// $admin_id = $this->auth->id;
|
||||||
|
$ids = $this->request->post('ids/s');
|
||||||
|
|
||||||
|
try{
|
||||||
|
$menulist = $this->model->del($ids,true);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->success('删除成功', $menulist);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ApiTitle(添加成员)
|
||||||
|
* @ApiSummary(添加成员)
|
||||||
|
* @ApiMethod(POST)
|
||||||
|
* @ApiParams(name = "name", type = "int",required=true,description = "姓名")
|
||||||
|
* @ApiParams(name = "idnum", type = "string",required=true,description = "身份证号")
|
||||||
|
* @ApiReturn({
|
||||||
|
*
|
||||||
|
*})
|
||||||
|
*/
|
||||||
|
public function add(){
|
||||||
|
|
||||||
|
$user_id = 0;
|
||||||
|
$user = $this->auth->getUser();//登录用户
|
||||||
|
if($user)$user_id = $user['id'];
|
||||||
|
$params = [];
|
||||||
|
$params["user_id"] = $user_id; //老师id
|
||||||
|
$params["name"] = $this->request->post('name/s', ''); //课程标签
|
||||||
|
$params["idnum"] = $this->request->post('idnum/s', ''); //课程标签
|
||||||
|
|
||||||
|
try{
|
||||||
|
$res = $this->model->add($params,true);
|
||||||
|
}catch (\Throwable $e){
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
}
|
||||||
|
$this->success('添加成功', $res);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ApiTitle(编辑成员)
|
||||||
|
* @ApiSummary(编辑成员)
|
||||||
|
* @ApiMethod(POST)
|
||||||
|
* @ApiRoute (/api/school.newactivity.activity_join/edit/ids/{ids})
|
||||||
|
* @ApiParams (name="ids", type="string", required=true, description="需要编辑的id")
|
||||||
|
* @ApiParams(name = "name", type = "int",required=true,description = "姓名")
|
||||||
|
* @ApiParams(name = "idnum", type = "string",required=true,description = "身份证号")
|
||||||
|
* @ApiReturn({
|
||||||
|
*
|
||||||
|
*})
|
||||||
|
*/
|
||||||
|
public function edit($ids = null){
|
||||||
|
|
||||||
|
$user_id = 0;
|
||||||
|
$user = $this->auth->getUser();//登录用户
|
||||||
|
if($user)$user_id = $user['id'];
|
||||||
|
$params = [];
|
||||||
|
$params["user_id"] = $user_id; //老师id
|
||||||
|
$params["name"] = $this->request->post('name/s', ''); //课程标签
|
||||||
|
$params["idnum"] = $this->request->post('idnum/s', ''); //课程标签
|
||||||
|
|
||||||
|
try{
|
||||||
|
$res = $this->model->edit($ids,$params,true);
|
||||||
|
}catch (\Throwable $e){
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
}
|
||||||
|
$this->success('编辑成功', $res);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -147,8 +147,9 @@ class Order extends Base
|
|||||||
* @ApiMethod(POST)
|
* @ApiMethod(POST)
|
||||||
* @ApiParams(name = "activity_id", type = "int",required=true,description = "活动id")
|
* @ApiParams(name = "activity_id", type = "int",required=true,description = "活动id")
|
||||||
* @ApiParams(name = "order_no", type = "string",required=false,description = "缓存key")
|
* @ApiParams(name = "order_no", type = "string",required=false,description = "缓存key")
|
||||||
* @ApiParams(name = "num", type = "int",required=true,description = "购买人数")
|
* @ApiParams(name = "people", type = "string",required=true,description = "(需url编码)参与人员信息json [{name:"小明",idnum:"410303199501220515"}]")
|
||||||
* @ApiParams(name = "is_compute", type = "int",required=false,description = "是否重新计算并更新缓存 默认传1")
|
* @ApiParams(name = "is_compute", type = "int",required=false,description = "是否重新计算并更新缓存 默认传1")
|
||||||
|
* @ApiParams(name = "desc", type = "string",required=false,description = "下单备注")
|
||||||
* @ApiReturn({
|
* @ApiReturn({
|
||||||
*
|
*
|
||||||
*})
|
*})
|
||||||
@ -158,13 +159,25 @@ class Order extends Base
|
|||||||
$user = $this->auth->getUser();//登录用户
|
$user = $this->auth->getUser();//登录用户
|
||||||
if($user)$user_id = $user['id'];
|
if($user)$user_id = $user['id'];
|
||||||
$activity_id = $this->request->post('activity_id/d', 0); //课程id
|
$activity_id = $this->request->post('activity_id/d', 0); //课程id
|
||||||
$num = $this->request->post('num/d', 0); //想同时约的课时id
|
// $num = $this->request->post('num/d', 0); //想同时约的课时id
|
||||||
// $param = urldecode($this->request->post('param/s', "{}")); //参数
|
$num = 0; //想同时约的课时id
|
||||||
|
|
||||||
$param = [];
|
$param = [];
|
||||||
|
|
||||||
|
$people = urldecode($this->request->post('people/s', "{}") ?: "{}"); //参数
|
||||||
|
// if($people){
|
||||||
|
$param["people"] = json_decode($people,true);
|
||||||
|
$num = count($param["people"]);
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
//参数
|
//参数
|
||||||
$order_no = $this->request->post('order_no/s', ''); //订单号
|
$order_no = $this->request->post('order_no/s', ''); //订单号
|
||||||
$is_compute = $this->request->post('is_compute/d', 1); //是否重新计算并更新缓存
|
$is_compute = $this->request->post('is_compute/d', 1); //是否重新计算并更新缓存
|
||||||
|
|
||||||
|
|
||||||
|
$param["desc"] = $this->request->post('desc/s', ''); //订单号
|
||||||
|
|
||||||
try{
|
try{
|
||||||
//当前申请状态
|
//当前申请状态
|
||||||
$res = $this->model->confirm($user_id, $activity_id,$num,$order_no,$param, $is_compute);
|
$res = $this->model->confirm($user_id, $activity_id,$num,$order_no,$param, $is_compute);
|
||||||
|
@ -180,12 +180,13 @@ class SettleLog extends Base
|
|||||||
$user = $this->auth->getUser();//登录用户
|
$user = $this->auth->getUser();//登录用户
|
||||||
if($user)$user_id = $user['id'];
|
if($user)$user_id = $user['id'];
|
||||||
$params =[];
|
$params =[];
|
||||||
$params["name"] = $this->request->post('name/s', ''); //页数
|
$params["name"] = $this->request->param('name/s', ''); //页数
|
||||||
$params["bank_name"] = $this->request->post('bank_name/s', ''); //条数
|
$params["bank_name"] = $this->request->param('bank_name/s', ''); //条数
|
||||||
$params["bank_user_name"] = $this->request->post('bank_user_name/s', ''); //搜索关键字
|
$params["bank_user_name"] = $this->request->param('bank_user_name/s', ''); //搜索关键字
|
||||||
$params["id_number"] = $this->request->post('id_number/s', ''); //搜索关键字
|
$params["id_number"] = $this->request->param('id_number/s', ''); //搜索关键字
|
||||||
|
|
||||||
$params = [];
|
// $params = [];
|
||||||
|
//
|
||||||
// $params["auth_status"] = $this->request->get('auth_status/s', ''); //搜索关键字
|
// $params["auth_status"] = $this->request->get('auth_status/s', ''); //搜索关键字
|
||||||
|
|
||||||
// $activity_id = $this->request->get('activity_id/s', ''); //搜索关键字
|
// $activity_id = $this->request->get('activity_id/s', ''); //搜索关键字
|
||||||
|
186
application/common/model/cardocr/Card.php
Normal file
186
application/common/model/cardocr/Card.php
Normal file
@ -0,0 +1,186 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\common\model\cardocr;
|
||||||
|
|
||||||
|
use app\common\model\BaseModel;
|
||||||
|
use think\Config;
|
||||||
|
use think\Model;
|
||||||
|
|
||||||
|
class Card extends BaseModel
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
// 表名
|
||||||
|
protected $name = 'cardocr';
|
||||||
|
|
||||||
|
// 自动写入时间戳字段
|
||||||
|
protected $autoWriteTimestamp = 'int';
|
||||||
|
|
||||||
|
// 定义时间戳字段名
|
||||||
|
protected $createTime = 'createtime';
|
||||||
|
protected $updateTime = 'updatetime';
|
||||||
|
protected $deleteTime = false;
|
||||||
|
|
||||||
|
// 追加属性
|
||||||
|
protected $append = [
|
||||||
|
'sex_text',
|
||||||
|
'publishtime_text'
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
public function getSexList()
|
||||||
|
{
|
||||||
|
return ['男' => __('男'), '女' => __('女'), '未知' => __('未知')];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getStatusList()
|
||||||
|
{
|
||||||
|
return ['0' => __('Down'), '1' => __('Pass'), '2' => __('Unaudited')];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getSexTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ? $value : (isset($data['sex']) ? $data['sex'] : '');
|
||||||
|
$list = $this->getSexList();
|
||||||
|
return isset($list[$value]) ? $list[$value] : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getPublishtimeTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ? $value : (isset($data['publishtime']) ? $data['publishtime'] : '');
|
||||||
|
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function setPublishtimeAttr($value)
|
||||||
|
{
|
||||||
|
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function user()
|
||||||
|
{
|
||||||
|
return $this->belongsTo('app\common\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** 新增实名认证
|
||||||
|
* @param $params
|
||||||
|
* @param $trans
|
||||||
|
* @return $this
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
|
public function add($params,$trans=false){
|
||||||
|
|
||||||
|
if (empty($params)) {
|
||||||
|
throw new \Exception(__('Parameter %s can not be empty', ''));
|
||||||
|
}
|
||||||
|
|
||||||
|
$rule = [
|
||||||
|
'user_id'=>'require',
|
||||||
|
'name'=>'require',
|
||||||
|
'idnum'=>'require',
|
||||||
|
'positive_img' => 'require',
|
||||||
|
'back_img'=>'require',
|
||||||
|
];
|
||||||
|
|
||||||
|
$rule_msg = [
|
||||||
|
"user_id.require"=>'认证用户必填',
|
||||||
|
"name.require"=>'姓名必填',
|
||||||
|
"idnum.require"=>'身份证号必填',
|
||||||
|
'positive_img.require' => '身份证正面必填',
|
||||||
|
'back_img.require' => '身份证反面必填',
|
||||||
|
];
|
||||||
|
|
||||||
|
self::check($params,$rule,$rule_msg);
|
||||||
|
|
||||||
|
|
||||||
|
$user_id = $params["user_id"];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//开启api验证
|
||||||
|
if (config("site.realname_isthroughapi")) {
|
||||||
|
$url = Config::get('upload.cdnurl');
|
||||||
|
$ImageUrl = cdnurl($params['positive_img'],true);
|
||||||
|
$ImagebackUrl = cdnurl($params['back_img'],true);
|
||||||
|
|
||||||
|
//orc获取正面信息
|
||||||
|
$front_data = $this->checkfront($ImageUrl);
|
||||||
|
$front_data = array_change_key_case($front_data, CASE_LOWER);
|
||||||
|
$params = $front_data + $params;
|
||||||
|
|
||||||
|
//orc获取反面信息
|
||||||
|
$back_data = $this->checkback($ImagebackUrl);
|
||||||
|
$back_data = array_change_key_case($back_data['backdata'], CASE_LOWER);
|
||||||
|
|
||||||
|
//修改审核通过
|
||||||
|
$params['status'] = 1;
|
||||||
|
$params["publishtime"] = time();
|
||||||
|
$params = array_filter($back_data) + $params;
|
||||||
|
|
||||||
|
//调用api身份证实名验证
|
||||||
|
$params_data = \addons\cardocr\library\Card::checkidcard($params['idnum'], $params['name']);
|
||||||
|
|
||||||
|
|
||||||
|
if ($params_data['Result'] != 0) {
|
||||||
|
throw new \Exception(__('姓名与身份号码不一致', ''));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(config("site.real_name_automatic_approval")){
|
||||||
|
$params['status'] = 1;
|
||||||
|
$params["publishtime"] = time();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//判断逻辑
|
||||||
|
if($trans){
|
||||||
|
self::beginTrans();
|
||||||
|
}
|
||||||
|
$res = true;
|
||||||
|
try{
|
||||||
|
//查询是否有认证信息,如果有则修改,如果没有则添加
|
||||||
|
$card = self::where('user_id',$user_id)->find();
|
||||||
|
if($card){
|
||||||
|
$result = $card->allowField(true)->save($params);
|
||||||
|
$self = $card;
|
||||||
|
}else{
|
||||||
|
$result = $this->allowField(true)->save($params);
|
||||||
|
$self = $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if($trans){
|
||||||
|
self::commitTrans();
|
||||||
|
}
|
||||||
|
}catch (\Exception $e){
|
||||||
|
if($trans){
|
||||||
|
self::rollbackTrans();
|
||||||
|
}
|
||||||
|
throw new \Exception($e->getMessage().$e->getFile().$e->getLine());
|
||||||
|
}
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** 检测实名认证状态
|
||||||
|
* @param $user_id
|
||||||
|
*/
|
||||||
|
public function checkRealname($user_id=0){
|
||||||
|
//默认状态为-1未认证,0认证被拒绝,1认证通过,2=等待审核
|
||||||
|
$status = -1;
|
||||||
|
$card_info = self::where('user_id',$user_id)->find(); //认证信息
|
||||||
|
if($card_info){
|
||||||
|
$status = $card_info['status'];
|
||||||
|
}
|
||||||
|
return compact('status' , 'card_info');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -1032,6 +1032,8 @@ class Activity extends BaseModel
|
|||||||
|
|
||||||
$self['join_info'] = self::getJoininfo($id,$self["stock"],10);
|
$self['join_info'] = self::getJoininfo($id,$self["stock"],10);
|
||||||
|
|
||||||
|
$self['some_people'] = self::getSomePeople($id);
|
||||||
|
|
||||||
//退款政策
|
//退款政策
|
||||||
$self['refund_info'] = Refund::where("id",$self["refund_id"])->find();
|
$self['refund_info'] = Refund::where("id",$self["refund_id"])->find();
|
||||||
|
|
||||||
@ -1386,6 +1388,28 @@ class Activity extends BaseModel
|
|||||||
return compact("users","people_number","percent","stock");
|
return compact("users","people_number","percent","stock");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*** 下单片段
|
||||||
|
* @param $id
|
||||||
|
* @param $limit
|
||||||
|
* @return void
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
* @throws \think\exception\DbException
|
||||||
|
*/
|
||||||
|
public static function getSomePeople($id,$limit=3)
|
||||||
|
{
|
||||||
|
|
||||||
|
$users = [];
|
||||||
|
|
||||||
|
return compact("users");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** 取消活动
|
/** 取消活动
|
||||||
* @param $id
|
* @param $id
|
||||||
* @param $check
|
* @param $check
|
||||||
|
309
application/common/model/school/activity/Join.php
Normal file
309
application/common/model/school/activity/Join.php
Normal file
@ -0,0 +1,309 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\common\model\school\activity;
|
||||||
|
|
||||||
|
use app\common\model\BaseModel;
|
||||||
|
use think\Model;
|
||||||
|
|
||||||
|
|
||||||
|
class Join extends BaseModel
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 表名
|
||||||
|
protected $name = 'school_activity_join';
|
||||||
|
|
||||||
|
// 自动写入时间戳字段
|
||||||
|
protected $autoWriteTimestamp = 'integer';
|
||||||
|
|
||||||
|
// 定义时间戳字段名
|
||||||
|
protected $createTime = 'createtime';
|
||||||
|
protected $updateTime = 'updatetime';
|
||||||
|
protected $deleteTime = false;
|
||||||
|
|
||||||
|
// 追加属性
|
||||||
|
protected $append = [
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function user()
|
||||||
|
{
|
||||||
|
return $this->belongsTo('app\common\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** 通用新增(后台api版本)
|
||||||
|
* @param $params
|
||||||
|
* @param $trans
|
||||||
|
* @return $this
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
|
public function add($params,$trans=false){
|
||||||
|
|
||||||
|
if (empty($params)) {
|
||||||
|
throw new \Exception(__('Parameter %s can not be empty', ''));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$rule = [
|
||||||
|
'user_id'=>'require',
|
||||||
|
'name'=>'require',
|
||||||
|
'idnum'=>'require',
|
||||||
|
];
|
||||||
|
|
||||||
|
$rule_msg = [
|
||||||
|
"user_id.require"=>'用户必填',
|
||||||
|
"name.require"=>'姓名必填',
|
||||||
|
"idnum.require"=>'身份证号必填',
|
||||||
|
];
|
||||||
|
|
||||||
|
self::check($params,$rule,$rule_msg);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//判断逻辑
|
||||||
|
if($trans){
|
||||||
|
self::beginTrans();
|
||||||
|
}
|
||||||
|
$res = true;
|
||||||
|
try{
|
||||||
|
|
||||||
|
//是否采用模型验证
|
||||||
|
|
||||||
|
|
||||||
|
$result = $this->allowField(true)->save($params);
|
||||||
|
|
||||||
|
if($trans){
|
||||||
|
self::commitTrans();
|
||||||
|
}
|
||||||
|
}catch (\Exception $e){
|
||||||
|
if($trans){
|
||||||
|
self::rollbackTrans();
|
||||||
|
}
|
||||||
|
throw new \Exception($e->getMessage().$e->getFile().$e->getLine());
|
||||||
|
}
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** 通用编辑(后台api版本)
|
||||||
|
* @param $params
|
||||||
|
* @param $trans
|
||||||
|
* @return $this
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
|
public function edit($id,$params,$trans=false){
|
||||||
|
|
||||||
|
$row = $this->get($id);
|
||||||
|
if (!$row) {
|
||||||
|
throw new \Exception(__('No Results were found'));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (empty($params)) {
|
||||||
|
throw new \Exception(__('Parameter %s can not be empty', ''));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$rule = [
|
||||||
|
'user_id'=>'require',
|
||||||
|
'name'=>'require',
|
||||||
|
'idnum'=>'require',
|
||||||
|
];
|
||||||
|
|
||||||
|
$rule_msg = [
|
||||||
|
"user_id.require"=>'用户必填',
|
||||||
|
"name.require"=>'姓名必填',
|
||||||
|
"idnum.require"=>'身份证号必填',
|
||||||
|
];
|
||||||
|
|
||||||
|
self::check($params,$rule,$rule_msg);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//判断逻辑
|
||||||
|
if($trans){
|
||||||
|
self::beginTrans();
|
||||||
|
}
|
||||||
|
$res = true;
|
||||||
|
try{
|
||||||
|
|
||||||
|
|
||||||
|
$result = $row->allowField(true)->save($params);
|
||||||
|
|
||||||
|
if($trans){
|
||||||
|
self::commitTrans();
|
||||||
|
}
|
||||||
|
}catch (\Exception $e){
|
||||||
|
if($trans){
|
||||||
|
self::rollbackTrans();
|
||||||
|
}
|
||||||
|
throw new \Exception($e->getMessage().$e->getFile().$e->getLine());
|
||||||
|
}
|
||||||
|
return $row;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** 通用详情(后台api版本)
|
||||||
|
* @param $params
|
||||||
|
* @param $trans
|
||||||
|
* @return $this
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
|
public function detail($id,$show_field=[],$except_field=[]){
|
||||||
|
$row = $this->get($id);
|
||||||
|
if (!$row) {
|
||||||
|
throw new \Exception(__('No Results were found'));
|
||||||
|
}
|
||||||
|
if($show_field){
|
||||||
|
$row->visible($show_field);
|
||||||
|
}
|
||||||
|
if($except_field){
|
||||||
|
$row->hidden($except_field);
|
||||||
|
}
|
||||||
|
return $row;
|
||||||
|
}
|
||||||
|
|
||||||
|
// public function index($page,$limit,$where=[])
|
||||||
|
// {
|
||||||
|
// $adminIds = $this->getDataLimitAdminIds();
|
||||||
|
// $aliasName = "" ;
|
||||||
|
// if (is_array($adminIds)) {
|
||||||
|
// $where[] = [$aliasName . $this->dataLimitField, 'in', $adminIds];
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
/** 通用删除(后台api版本)
|
||||||
|
* @param $params
|
||||||
|
* @param $trans
|
||||||
|
* @return $this
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
|
public function del($ids = null,$trans=false){
|
||||||
|
if (empty($ids)) {
|
||||||
|
throw new \Exception(__('Parameter %s can not be empty', 'ids'));
|
||||||
|
}
|
||||||
|
//判断逻辑
|
||||||
|
|
||||||
|
$pk = $this->getPk();
|
||||||
|
|
||||||
|
$list = $this->where($pk, 'in', $ids)->select();
|
||||||
|
$count = 0;
|
||||||
|
if($trans){
|
||||||
|
self::beginTrans();
|
||||||
|
}
|
||||||
|
$res = true;
|
||||||
|
try{
|
||||||
|
|
||||||
|
foreach ($list as $item) {
|
||||||
|
$count += $item->delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
if($trans){
|
||||||
|
self::commitTrans();
|
||||||
|
}
|
||||||
|
}catch (\Exception $e){
|
||||||
|
if($trans){
|
||||||
|
self::rollbackTrans();
|
||||||
|
}
|
||||||
|
throw new \Exception($e->getMessage().$e->getFile().$e->getLine());
|
||||||
|
}
|
||||||
|
return $count;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**得到基础条件
|
||||||
|
* @param $status
|
||||||
|
* @param null $model
|
||||||
|
* @param string $alisa
|
||||||
|
*/
|
||||||
|
public static function getBaseWhere($whereData = [], $model = null, $alisa = '',$with = false)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!$model) {
|
||||||
|
$model = new static;
|
||||||
|
if ($alisa&&!$with) $model = $model->alias($alisa);
|
||||||
|
}
|
||||||
|
if ($alisa) $alisa = $alisa . '.';
|
||||||
|
$tableFields = (new static)->getTableFields();
|
||||||
|
foreach ($tableFields as $fields)
|
||||||
|
{
|
||||||
|
if(in_array($fields, ["user_id"]))continue;
|
||||||
|
// if (isset($whereData[$fields]) && $whereData[$fields]) $model = $model->where("{$alisa}{$fields}", '=', $whereData[$fields]);
|
||||||
|
|
||||||
|
if (isset($whereData[$fields]) && $whereData[$fields]){
|
||||||
|
if(is_array($whereData[$fields])){
|
||||||
|
$model = $model->where("{$alisa}{$fields}", $whereData[$fields][0], $whereData[$fields][1]);
|
||||||
|
}else{
|
||||||
|
$model = $model->where("{$alisa}{$fields}", '=', $whereData[$fields]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
if (isset($whereData['user_id']) && $whereData['user_id']) $model = $model->where("{$alisa}user_id", 'in', $whereData['user_id']);
|
||||||
|
|
||||||
|
if (isset($whereData['keywords'])&&$whereData['keywords']) $model = $model->where("{$alisa}name|{$alisa}idnum", 'like', "%". $whereData['keywords']."%");
|
||||||
|
|
||||||
|
if (isset($whereData['time'])&&$whereData['time']){
|
||||||
|
$model = $model->time(["{$alisa}createtime",$whereData['time']]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return $model;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static function joinList($page, $limit,$params=[]){
|
||||||
|
$with_field = [
|
||||||
|
'base'=>['*'],
|
||||||
|
];
|
||||||
|
$alisa = (new self)->getWithAlisaName();
|
||||||
|
$sort = "{$alisa}.id desc";
|
||||||
|
$serch_where = [];
|
||||||
|
$serch_where = array_merge($serch_where,$params);
|
||||||
|
return (new self)->getBaseList($serch_where, $page, $limit,$sort,$with_field);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -849,7 +849,7 @@ class Order extends BaseModel
|
|||||||
//订单支付更新
|
//订单支付更新
|
||||||
$order = self::updatePay($order,$notify);
|
$order = self::updatePay($order,$notify);
|
||||||
//生成订单一维码和二维码
|
//生成订单一维码和二维码
|
||||||
$order = self::buildCode($order);
|
// $order = self::buildCode($order);
|
||||||
//记录订单日志
|
//记录订单日志
|
||||||
OrderLog::log($order['id'],"活动订单支付成功,核销码生成,等待核销",'user',$order['user_id']);
|
OrderLog::log($order['id'],"活动订单支付成功,核销码生成,等待核销",'user',$order['user_id']);
|
||||||
//调用支付成功事件
|
//调用支付成功事件
|
||||||
@ -862,7 +862,7 @@ class Order extends BaseModel
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static function buildCode($order){
|
public static function buildCode($order,$people=[]){
|
||||||
if(is_string($order)||is_numeric($order))$order = self::getNopayOrder($order);
|
if(is_string($order)||is_numeric($order))$order = self::getNopayOrder($order);
|
||||||
|
|
||||||
$num = $order['num'];
|
$num = $order['num'];
|
||||||
@ -872,6 +872,12 @@ class Order extends BaseModel
|
|||||||
"status" =>'3',
|
"status" =>'3',
|
||||||
"activity_id"=>$order['activity_id'],
|
"activity_id"=>$order['activity_id'],
|
||||||
];
|
];
|
||||||
|
if($people && isset($people[$i])){
|
||||||
|
$params["name"] = $people[$i]["name"];
|
||||||
|
$params["idnum"] = $people[$i]["idnum"];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$orderCode = OrderCode::create($params);
|
$orderCode = OrderCode::create($params);
|
||||||
$orderCode["code"] = en_code($orderCode["id"]);
|
$orderCode["code"] = en_code($orderCode["id"]);
|
||||||
$orderCode["miniurl"] = self::getMiniQrcodeLink(["order_id"=>$order['id'],"code"=>$orderCode["code"]]);
|
$orderCode["miniurl"] = self::getMiniQrcodeLink(["order_id"=>$order['id'],"code"=>$orderCode["code"]]);
|
||||||
@ -1017,6 +1023,8 @@ class Order extends BaseModel
|
|||||||
//组装订单数据 compact('order_data','activity_info','user_data',"activity_info");
|
//组装订单数据 compact('order_data','activity_info','user_data',"activity_info");
|
||||||
$order_data = $order_info['order_data'];
|
$order_data = $order_info['order_data'];
|
||||||
$order_data["order_no"] = $order_no;
|
$order_data["order_no"] = $order_no;
|
||||||
|
$order_data["desc"] = $param["desc"] ?? $remark;
|
||||||
|
|
||||||
|
|
||||||
$res1 = self::create($order_data);
|
$res1 = self::create($order_data);
|
||||||
if (!$res1) throw new \Exception('创建订单失败');
|
if (!$res1) throw new \Exception('创建订单失败');
|
||||||
@ -1056,6 +1064,11 @@ class Order extends BaseModel
|
|||||||
|
|
||||||
//记录订单日志
|
//记录订单日志
|
||||||
OrderLog::log($res1['id'],"活动订单创建成功,等待下一步操作(如果付费需去支付)",'user',$user_id);
|
OrderLog::log($res1['id'],"活动订单创建成功,等待下一步操作(如果付费需去支付)",'user',$user_id);
|
||||||
|
|
||||||
|
|
||||||
|
//生成订单一维码和二维码
|
||||||
|
$order = self::buildCode($res1['id'], $param["people"] ?? [] );
|
||||||
|
|
||||||
//7事件
|
//7事件
|
||||||
$data = ['order' => self::where("id",$res1['id'])->find()];
|
$data = ['order' => self::where("id",$res1['id'])->find()];
|
||||||
\think\Hook::listen('activity_order_create_after', $data);
|
\think\Hook::listen('activity_order_create_after', $data);
|
||||||
|
@ -75,8 +75,9 @@ class Userwithdrawal extends BaseModel
|
|||||||
//) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户银行卡绑定';
|
//) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户银行卡绑定';
|
||||||
//这里应对基础提交信息做验证:开户行名称bank_name,转账账户名name,银行账户号bank_user_name,身份证号id_number
|
//这里应对基础提交信息做验证:开户行名称bank_name,转账账户名name,银行账户号bank_user_name,身份证号id_number
|
||||||
//以下对每个字段做验证,如果验证不通过,则抛出异常
|
//以下对每个字段做验证,如果验证不通过,则抛出异常
|
||||||
|
$params["user_id"] = $user_id;
|
||||||
$rule = [
|
$rule = [
|
||||||
|
'user_id'=>'require',
|
||||||
'bank_name'=>'require',
|
'bank_name'=>'require',
|
||||||
'name'=>'require',
|
'name'=>'require',
|
||||||
'bank_user_name'=>'require',
|
'bank_user_name'=>'require',
|
||||||
@ -84,7 +85,9 @@ class Userwithdrawal extends BaseModel
|
|||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$rule_msg = [
|
$rule_msg = [
|
||||||
|
'user_id.require'=>'用户不能为空',
|
||||||
'bank_name.require'=>'开户行名称不能为空',
|
'bank_name.require'=>'开户行名称不能为空',
|
||||||
'name.require'=>'转账账户名不能为空',
|
'name.require'=>'转账账户名不能为空',
|
||||||
'bank_user_name.require'=>'银行账户号不能为空',
|
'bank_user_name.require'=>'银行账户号不能为空',
|
||||||
|
@ -142,8 +142,8 @@ class UserwithdrawalLog extends BaseModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (isset($whereData['status'])) $model = $model->where("{$alisa}status", 'in', $whereData['status']);
|
if (isset($whereData['status']) && $whereData['status']!=="" && $whereData['status']!==null) $model = $model->where("{$alisa}status", 'in', $whereData['status']);
|
||||||
if (isset($whereData['not_status'])) $model = $model->where("{$alisa}status", 'not in', $whereData['not_status']);
|
if (isset($whereData['not_status']) && $whereData['not_status']!=="" && $whereData['not_status']!==null) $model = $model->where("{$alisa}status", 'not in', $whereData['not_status']);
|
||||||
|
|
||||||
if (isset($whereData['withdrawal_status']) && $whereData['withdrawal_status']!=="") $model = $model->where("{$alisa}withdrawal_status", 'in', $whereData['withdrawal_status']);
|
if (isset($whereData['withdrawal_status']) && $whereData['withdrawal_status']!=="") $model = $model->where("{$alisa}withdrawal_status", 'in', $whereData['withdrawal_status']);
|
||||||
if (isset($whereData['not_withdrawal_status'])&& $whereData['not_withdrawal_status']!=="") $model = $model->where("{$alisa}withdrawal_status", 'not in', $whereData['not_withdrawal_status']);
|
if (isset($whereData['not_withdrawal_status'])&& $whereData['not_withdrawal_status']!=="") $model = $model->where("{$alisa}withdrawal_status", 'not in', $whereData['not_withdrawal_status']);
|
||||||
@ -258,7 +258,7 @@ class UserwithdrawalLog extends BaseModel
|
|||||||
if($trans){
|
if($trans){
|
||||||
self::rollbackTrans();
|
self::rollbackTrans();
|
||||||
}
|
}
|
||||||
throw new \Exception($e->getMessage().$e->getFile().$e->getLine());
|
throw new \Exception($e->getMessage());
|
||||||
}
|
}
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
65
application/index/controller/Cardocr.php
Normal file
65
application/index/controller/Cardocr.php
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\index\controller;
|
||||||
|
|
||||||
|
use addons\cardocr\library\Card;
|
||||||
|
use addons\cardocr\library\traits\Check;
|
||||||
|
use app\common\controller\Frontend;
|
||||||
|
use think\Db;
|
||||||
|
use think\Exception;
|
||||||
|
use think\exception\PDOException;
|
||||||
|
use think\Request;
|
||||||
|
|
||||||
|
class Cardocr extends Frontend
|
||||||
|
{
|
||||||
|
//引入检查类
|
||||||
|
use Check;
|
||||||
|
protected $layout = 'default';
|
||||||
|
protected $noNeedRight = ['*'];
|
||||||
|
|
||||||
|
public function __construct(Request $request = null)
|
||||||
|
{
|
||||||
|
parent::__construct($request);
|
||||||
|
$this->assignconfig("title", __("Tencent Identity Card Network Authentication"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 身份证验证页面
|
||||||
|
* @return string
|
||||||
|
* @throws Exception
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
* @throws \think\exception\DbException
|
||||||
|
*/
|
||||||
|
public function docard()
|
||||||
|
{
|
||||||
|
$user_id = $this->auth->id;
|
||||||
|
$data = \addons\cardocr\model\Cardocr::where('user_id', '=', $user_id)->find();
|
||||||
|
$data = isset($data) ? $data->toArray() : array();
|
||||||
|
$status = isset($data['status']) ? $data['status'] : 0;
|
||||||
|
|
||||||
|
$username = isset($data['name']) ? Card::hidestr($data['name'], 0, -1) : "";
|
||||||
|
|
||||||
|
$idnum = isset($data['idnum']) ? Card::hidestr($data['idnum'], 5, 9) : "";
|
||||||
|
$positive_img = isset($data['positive_img']) ? $data['positive_img'] : "";
|
||||||
|
$back_img = isset($data['back_img']) ? $data['back_img'] : "";
|
||||||
|
|
||||||
|
$this->view->assign("status", $status);
|
||||||
|
$this->view->assign("name", $username);
|
||||||
|
$this->view->assign("idnum", $idnum);
|
||||||
|
$this->view->assign("positive_img", $positive_img);
|
||||||
|
$this->view->assign("back_img", $back_img);
|
||||||
|
$this->assignconfig('checkstatus', $status);
|
||||||
|
return $this->view->fetch();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
14
application/index/lang/zh-cn/cardocr.php
Normal file
14
application/index/lang/zh-cn/cardocr.php
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
return [
|
||||||
|
'Authentication' => '实名认证',
|
||||||
|
'positive-img' => '身份证正面',
|
||||||
|
'back-img' => '身份证反面',
|
||||||
|
'Username' => '姓名',
|
||||||
|
'IdCard' => '身份证号码',
|
||||||
|
'Identification' => '身份证实名',
|
||||||
|
'Tencent Identity Card Network Authentication'=>'腾讯身份证联网认证',
|
||||||
|
'Validdatestart' => '有效期开始',
|
||||||
|
'Validdateend' => '有效期结束',
|
||||||
|
'Sex' => '性别',
|
||||||
|
'IsthroughAPI'=>'是否人工审核'
|
||||||
|
];
|
256
application/index/view/cardocr/docard.html
Normal file
256
application/index/view/cardocr/docard.html
Normal file
@ -0,0 +1,256 @@
|
|||||||
|
<style>
|
||||||
|
.profile-avatar-container {
|
||||||
|
position: relative;
|
||||||
|
width: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.profile-avatar-container .profile-user-img {
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.profile-avatar-container .profile-avatar-text {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.profile-avatar-container:hover .profile-avatar-text {
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
height: 100px;
|
||||||
|
width: 100px;
|
||||||
|
background: #444;
|
||||||
|
opacity: .6;
|
||||||
|
color: #fff;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
line-height: 100px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.profile-avatar-container button {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div id="content-container" class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3">
|
||||||
|
{include file="common/sidenav" /}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-9">
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-body">
|
||||||
|
<h2 class="page-header">{:__('Identification')}</h2>
|
||||||
|
<form id="profile-form" class="form-horizontal" role="form" data-toggle="validator" method="POST"
|
||||||
|
action="{:url('/addons/cardocr/index')}">
|
||||||
|
{:token()}
|
||||||
|
|
||||||
|
{switch name="status"}
|
||||||
|
{case value="null"}
|
||||||
|
<div class="alert alert-info">
|
||||||
|
|
||||||
|
<strong>申请审核身份证!</strong>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Username')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-4">
|
||||||
|
<input type="text" class="form-control" id="username" name="username"
|
||||||
|
value="{$name|htmlentities}"
|
||||||
|
data-rule="required;xingming;"
|
||||||
|
data-rule-xingming="[/^[\u4E00-\u9FA5\uf900-\ufa2d·s]{2,20}$/, '请输入合法名字']"
|
||||||
|
placeholder="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('IdCard')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-4">
|
||||||
|
<input type="text" class="form-control" id="idnum" name="idnum"
|
||||||
|
value="{$idnum|htmlentities}"
|
||||||
|
data-rule="required;IDcard;remote({:url('cardocr/checkidcardavailable')}, id={$user.id})"
|
||||||
|
placeholder="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="c-image" class="control-label col-xs-12 col-sm-2">{:__('positive-img')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<div class="input-group">
|
||||||
|
<input id="c-image" class="form-control hidden" size="50" name="positive_img" type="text"
|
||||||
|
value="{$positive_img|default=''|htmlentities}" data-rule="required;">
|
||||||
|
<div class="group-addon no-border no-padding">
|
||||||
|
<span><button type="button" id="plupload-image" class="btn btn-danger plupload"
|
||||||
|
data-input-id="c-image" data-style="thumb"
|
||||||
|
data-mimetype="image/jpeg,image/png,image/jpg"
|
||||||
|
data-multiple="false" data-maxsize="3M" data-preview-id="p-image"><i
|
||||||
|
class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||||
|
<span class="msg-box n-right" for="c-image"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<ul class="row list-inline plupload-preview" id="p-image"></ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="c-image" class="control-label col-xs-12 col-sm-2">{:__('back-img')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<div class="input-group">
|
||||||
|
<input id="c-back-img" class="form-control hidden" size="50" name="back_img" type="text"
|
||||||
|
value="{$back_img|default=''|htmlentities}" data-rule="required;">
|
||||||
|
<div class="group-addon no-border no-padding">
|
||||||
|
<span><button type="button" id="plupload-back-img"
|
||||||
|
class="btn btn-danger plupload" data-input-id="c-back-img"
|
||||||
|
data-style="thumb" data-mimetype="image/jpeg,image/png,image/jpg"
|
||||||
|
data-multiple="false" data-maxsize="3M"
|
||||||
|
data-preview-id="p-back-img"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||||
|
<span class="msg-box n-right" for="c-back-img"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<ul class="row list-inline plupload-preview" id="p-back-img"></ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group normal-footer">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('Ok')}</button>
|
||||||
|
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/case}
|
||||||
|
|
||||||
|
{case value="0"}
|
||||||
|
|
||||||
|
<div class="alert alert-warning">
|
||||||
|
|
||||||
|
<strong>拒绝审核身份证!</strong>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Username')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-4">
|
||||||
|
<input type="text" class="form-control" id="username" name="username"
|
||||||
|
value="{$name|htmlentities}"
|
||||||
|
data-rule="required;xingming;"
|
||||||
|
data-rule-xingming="[/^[\u4E00-\u9FA5\uf900-\ufa2d·s]{2,20}$/, '请输入合法名字']"
|
||||||
|
placeholder="" disabled="disabled">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('IdCard')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-4">
|
||||||
|
<input type="text" class="form-control" id="idnum" name="idnum"
|
||||||
|
value="{$idnum|htmlentities}"
|
||||||
|
data-rule="required;IDcard;remote({:url('cardocr/checkidcardavailable')}, id={$user.id})"
|
||||||
|
placeholder="" disabled="disabled">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/case}
|
||||||
|
|
||||||
|
|
||||||
|
{case value="1"}
|
||||||
|
<div class="alert alert-success">
|
||||||
|
|
||||||
|
<strong>已经审核身份证!</strong>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Username')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-4">
|
||||||
|
<input type="text" class="form-control" id="username" name="username"
|
||||||
|
value="{$name|htmlentities}"
|
||||||
|
data-rule="required;xingming;"
|
||||||
|
data-rule-xingming="[/^[\u4E00-\u9FA5\uf900-\ufa2d·s]{2,20}$/, '请输入合法名字']"
|
||||||
|
placeholder="" disabled="disabled" >
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('IdCard')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-4">
|
||||||
|
<input type="text" class="form-control" id="idnum" name="idnum"
|
||||||
|
value="{$idnum|htmlentities}"
|
||||||
|
data-rule="required;IDcard;remote({:url('cardocr/checkidcardavailable')}, id={$user.id})"
|
||||||
|
placeholder="" disabled="disabled">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/case}
|
||||||
|
|
||||||
|
|
||||||
|
{case value="2"}
|
||||||
|
<div class="alert alert-info">
|
||||||
|
|
||||||
|
<strong>等待审核身份证!</strong>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Username')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-4">
|
||||||
|
<input type="text" class="form-control" id="username" name="username"
|
||||||
|
value="{$name|htmlentities}"
|
||||||
|
data-rule="required;xingming;"
|
||||||
|
data-rule-xingming="[/^[\u4E00-\u9FA5\uf900-\ufa2d·s]{2,20}$/, '请输入合法名字']"
|
||||||
|
placeholder="" disabled="disabled">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('IdCard')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-4">
|
||||||
|
<input type="text" class="form-control" id="idnum" name="idnum"
|
||||||
|
value="{$idnum|htmlentities}"
|
||||||
|
data-rule="required;IDcard;remote({:url('cardocr/checkidcardavailable')}, id={$user.id})"
|
||||||
|
placeholder="" disabled="disabled">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{/case}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{default /}
|
||||||
|
|
||||||
|
{/switch}
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.form-layer {
|
||||||
|
height: 100%;
|
||||||
|
min-height: 150px;
|
||||||
|
min-width: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-body {
|
||||||
|
width: 100%;
|
||||||
|
overflow: auto;
|
||||||
|
top: 0;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 10;
|
||||||
|
bottom: 50px;
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-layer .form-footer {
|
||||||
|
height: 50px;
|
||||||
|
line-height: 50px;
|
||||||
|
background-color: #ecf0f1;
|
||||||
|
width: 100%;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 200;
|
||||||
|
bottom: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-footer .form-group {
|
||||||
|
margin-left: 0;
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
</style>
|
119
public/assets/js/backend/cardocr/card.js
Normal file
119
public/assets/js/backend/cardocr/card.js
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||||
|
|
||||||
|
var Controller = {
|
||||||
|
index: function () {
|
||||||
|
// 初始化表格参数配置
|
||||||
|
Table.api.init({
|
||||||
|
extend: {
|
||||||
|
index_url: 'cardocr/card/index' + location.search,
|
||||||
|
add_url: 'cardocr/card/add',
|
||||||
|
edit_url: 'cardocr/card/edit',
|
||||||
|
del_url: 'cardocr/card/del',
|
||||||
|
multi_url: 'cardocr/card/multi',
|
||||||
|
table: 'cardocr',
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var table = $("#table");
|
||||||
|
|
||||||
|
// 初始化表格
|
||||||
|
table.bootstrapTable({
|
||||||
|
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||||
|
pk: 'id',
|
||||||
|
sortName: 'id',
|
||||||
|
columns: [
|
||||||
|
[
|
||||||
|
{checkbox: true},
|
||||||
|
{field: 'id', title: __('Id')},
|
||||||
|
{field: 'user_id', title: __('User_id')},
|
||||||
|
{field: 'user.nickname', title: __('User.nickname')},
|
||||||
|
{field: 'name', title: __('Name')},
|
||||||
|
{
|
||||||
|
field: 'sex',
|
||||||
|
title: __('Sex'),
|
||||||
|
searchList: {"男": __('男'), "女": __('女'), "未知": __('未知')},
|
||||||
|
formatter: Table.api.formatter.normal
|
||||||
|
},
|
||||||
|
{field: 'nation', title: __('Nation')},
|
||||||
|
{field: 'birth', title: __('Birth'), operate: 'RANGE', addclass: 'datetimerange'},
|
||||||
|
{field: 'address', title: __('Address')},
|
||||||
|
{field: 'idnum', title: __('Idnum')},
|
||||||
|
{field: 'authority', title: __('Authority')},
|
||||||
|
{
|
||||||
|
field: 'validdatestart',
|
||||||
|
title: __('Validdatestart'),
|
||||||
|
operate: 'RANGE',
|
||||||
|
addclass: 'datetimerange'
|
||||||
|
},
|
||||||
|
{field: 'validdateend', title: __('Validdateend'), operate: 'RANGE', addclass: 'datetimerange'},
|
||||||
|
{
|
||||||
|
field: 'status',
|
||||||
|
title: __('Status'),
|
||||||
|
formatter: Table.api.formatter.status,
|
||||||
|
searchList: {"2": __("Unaudited"), "1": __('Pass'), "0": __('Down')}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'positive_img',
|
||||||
|
title: __('Positive_img'),
|
||||||
|
events: Table.api.events.image,
|
||||||
|
formatter: Table.api.formatter.image,
|
||||||
|
operate: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'back_img',
|
||||||
|
title: __('Back_img'),
|
||||||
|
events: Table.api.events.image,
|
||||||
|
formatter: Table.api.formatter.image,
|
||||||
|
operate: false
|
||||||
|
},
|
||||||
|
{field: 'memo', title: __('Memo')},
|
||||||
|
{
|
||||||
|
field: 'createtime',
|
||||||
|
title: __('Createtime'),
|
||||||
|
operate: 'RANGE',
|
||||||
|
addclass: 'datetimerange',
|
||||||
|
formatter: Table.api.formatter.datetime
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'updatetime',
|
||||||
|
title: __('Updatetime'),
|
||||||
|
operate: 'RANGE',
|
||||||
|
addclass: 'datetimerange',
|
||||||
|
formatter: Table.api.formatter.datetime
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'publishtime',
|
||||||
|
title: __('Publishtime'),
|
||||||
|
operate: 'RANGE',
|
||||||
|
addclass: 'datetimerange',
|
||||||
|
formatter: Table.api.formatter.datetime
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'operate',
|
||||||
|
title: __('Operate'),
|
||||||
|
table: table,
|
||||||
|
events: Table.api.events.operate,
|
||||||
|
formatter: Table.api.formatter.operate
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
// 为表格绑定事件
|
||||||
|
Table.api.bindevent(table);
|
||||||
|
},
|
||||||
|
add: function () {
|
||||||
|
// Controller.api.bindevent();
|
||||||
|
Form.api.bindevent($("form[role=form]"));
|
||||||
|
},
|
||||||
|
edit: function () {
|
||||||
|
Controller.api.bindevent();
|
||||||
|
},
|
||||||
|
api: {
|
||||||
|
bindevent: function () {
|
||||||
|
Form.api.bindevent($("form[role=form]"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return Controller;
|
||||||
|
});
|
58
public/assets/js/backend/school/activity/join.js
Normal file
58
public/assets/js/backend/school/activity/join.js
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||||
|
|
||||||
|
var Controller = {
|
||||||
|
index: function () {
|
||||||
|
// 初始化表格参数配置
|
||||||
|
Table.api.init({
|
||||||
|
extend: {
|
||||||
|
index_url: 'school/activity/join/index' + location.search,
|
||||||
|
add_url: 'school/activity/join/add',
|
||||||
|
edit_url: 'school/activity/join/edit',
|
||||||
|
del_url: 'school/activity/join/del',
|
||||||
|
multi_url: 'school/activity/join/multi',
|
||||||
|
import_url: 'school/activity/join/import',
|
||||||
|
table: 'school_activity_join',
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var table = $("#table");
|
||||||
|
|
||||||
|
// 初始化表格
|
||||||
|
table.bootstrapTable({
|
||||||
|
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||||
|
pk: 'id',
|
||||||
|
sortName: 'id',
|
||||||
|
columns: [
|
||||||
|
[
|
||||||
|
{checkbox: true},
|
||||||
|
{field: 'id', title: __('Id')},
|
||||||
|
{field: 'user_id', title: __('User_id')},
|
||||||
|
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
||||||
|
{field: 'idnum', title: __('Idnum'), operate: 'LIKE'},
|
||||||
|
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||||
|
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||||
|
{field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
|
||||||
|
{field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'},
|
||||||
|
{field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||||
|
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
// 为表格绑定事件
|
||||||
|
Table.api.bindevent(table);
|
||||||
|
},
|
||||||
|
add: function () {
|
||||||
|
Controller.api.bindevent();
|
||||||
|
},
|
||||||
|
edit: function () {
|
||||||
|
Controller.api.bindevent();
|
||||||
|
},
|
||||||
|
api: {
|
||||||
|
bindevent: function () {
|
||||||
|
Form.api.bindevent($("form[role=form]"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return Controller;
|
||||||
|
});
|
39
public/assets/js/frontend/cardocr.js
Normal file
39
public/assets/js/frontend/cardocr.js
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, undefined, Frontend, Form, Template) {
|
||||||
|
|
||||||
|
var Controller = {
|
||||||
|
docard: function () {
|
||||||
|
$("title").html(Config.title);
|
||||||
|
if (Config.checkstatus == 1) {
|
||||||
|
$("#username").attr("disabled", true);
|
||||||
|
$("#idnum").attr("disabled", true);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Form.api.bindevent($("form[role=form]"), function (data, ret) {
|
||||||
|
|
||||||
|
if (ret.result == 0) {
|
||||||
|
Toastr.success(ret.msg);
|
||||||
|
location.reload();
|
||||||
|
} else {
|
||||||
|
Toastr.error(ret.msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}, function (success, error) {
|
||||||
|
//错误提示码
|
||||||
|
// return false;
|
||||||
|
|
||||||
|
}, function () {
|
||||||
|
|
||||||
|
//已验证的身份证禁止提交表单
|
||||||
|
if (Config.checkstatus == 1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
};
|
||||||
|
return Controller;
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user