下单增加下单人员管理
增加下单备注 增加活动群二维码 以上剩余功能编写
This commit is contained in:
parent
08df146841
commit
1686145ab9
@ -4,6 +4,7 @@ return [
|
||||
'User_id' => '发布用户',
|
||||
'Title' => '标题',
|
||||
'Images' => '轮播图',
|
||||
'Image' => '加群二维码',
|
||||
'Address_city' => '城市选择',
|
||||
'Cate_ids' => '平台分类(标签)',
|
||||
'Province' => '省编号',
|
||||
|
@ -33,6 +33,24 @@
|
||||
<span style="color: red">( 推荐图片比例为 690*580 )</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<div class="input-group">
|
||||
<input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text">
|
||||
<div class="input-group-addon no-border no-padding">
|
||||
<span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp,video/*" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*,video/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||
</div>
|
||||
<span class="msg-box n-right" for="c-image"></span>
|
||||
</div>
|
||||
<ul class="row list-inline faupload-preview" id="p-image"></ul>
|
||||
<span style="color: red"><br> ( 推荐图片尺寸:320:459 )</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Cate_ids')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
@ -38,6 +38,24 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<div class="input-group">
|
||||
<input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
|
||||
<div class="input-group-addon no-border no-padding">
|
||||
<span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp,video/*" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*,video/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||
</div>
|
||||
<span class="msg-box n-right" for="c-image"></span>
|
||||
</div>
|
||||
<ul class="row list-inline faupload-preview" id="p-image"></ul>
|
||||
<span style="color: red"><br> ( 推荐图片尺寸:320:459 )</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Cate_ids')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
@ -37,6 +37,25 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<div class="input-group">
|
||||
<input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
|
||||
<div class="input-group-addon no-border no-padding">
|
||||
<span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp,video/*" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*,video/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||
</div>
|
||||
<span class="msg-box n-right" for="c-image"></span>
|
||||
</div>
|
||||
<ul class="row list-inline faupload-preview" id="p-image"></ul>
|
||||
<span style="color: red"><br> ( 推荐图片尺寸:320:459 )</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Cate_ids')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
@ -252,6 +252,18 @@
|
||||
<input id="c-refundsendtime" class="form-control datetimepicker" disabled data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[refundsendtime]" type="text" value="{:$row.refundsendtime?datetime($row.refundsendtime):''}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('下单备注')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-desc" class="form-control" disabled name="row[desc]" type="text" value="{$row.desc|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">-->
|
||||
|
@ -259,6 +259,7 @@ class NewActivity extends Base
|
||||
* @ApiParams(name = "content", type = "string",required=false,description = "活动详情")
|
||||
* @ApiParams(name = "price", type = "string",required=false,description = "报名单价 0为免费")
|
||||
* @ApiParams(name = "stock", type = "string",required=false,description = "活动限制人数")
|
||||
* @ApiParams(name = "image", type = "string",required=false,description = "入群二维码")
|
||||
* @ApiReturn({
|
||||
*
|
||||
*})
|
||||
@ -278,6 +279,7 @@ class NewActivity extends Base
|
||||
|
||||
$params["title"] = $this->request->post('title/s', ''); //老师id
|
||||
$params["images"] = $this->request->post('images/s', ''); //老师id
|
||||
$params["image"] = $this->request->post('image/s', ''); //老师id
|
||||
|
||||
$params["stock"] = $this->request->post('stock/d', 0); //核销次数
|
||||
//
|
||||
@ -374,5 +376,32 @@ class NewActivity extends Base
|
||||
$this->success('活动取消成功', $res);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @ApiTitle( 活动更换入群二维码)
|
||||
* @ApiSummary(活动更换入群二维码))
|
||||
* @ApiMethod(POST)
|
||||
* @ApiParams(name = "id", type = "string",required=true,description = "活动id")
|
||||
* @ApiParams(name = "image", type = "string",required=true,description = "加群二维码")
|
||||
* @ApiReturn({
|
||||
*
|
||||
*})
|
||||
*/
|
||||
public function edit_qrcode(){
|
||||
// $this->transactionCheck();
|
||||
$user_id = 0;
|
||||
$user = $this->auth->getUser();//登录用户
|
||||
if($user)$user_id = $user['id'];
|
||||
$id = $this->request->post('id/d', ''); //订单号
|
||||
$image = $this->request->post('image/s', ''); //订单号
|
||||
try{
|
||||
//当前申请状态
|
||||
$res = $this->model->editQrcode($user_id,$id,$image,true);
|
||||
}catch (\Throwable $e){
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success('活动更换入群二维码成功', $res);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -108,6 +108,10 @@ class Order extends Base
|
||||
// if($user_id =='670153'){
|
||||
// file_put_contents("ceshi66.txt",(new AppointmentOrder())->getLastSql());
|
||||
// }
|
||||
$res['activity_info'] = null;
|
||||
if($activity_id){
|
||||
$res['activity_info'] = (new \app\common\model\school\activity\Activity)->getActivityPeopleInfo($activity_id);
|
||||
}
|
||||
}catch (\Exception $e){
|
||||
|
||||
$this->error($e->getMessage());
|
||||
@ -145,6 +149,7 @@ class Order extends Base
|
||||
* @ApiTitle( 订单确认/订单计算接口)
|
||||
* @ApiSummary(订单确认/订单计算接口【有过期时间】)
|
||||
* @ApiMethod(POST)
|
||||
* @ApiParams(name = "num", type = "int",required=true,description = "人数")
|
||||
* @ApiParams(name = "activity_id", type = "int",required=true,description = "活动id")
|
||||
* @ApiParams(name = "order_no", type = "string",required=false,description = "缓存key")
|
||||
* @ApiParams(name = "people", type = "string",required=true,description = "(需url编码)参与人员信息json [{name:"小明",idnum:"410303199501220515"}]")
|
||||
@ -159,15 +164,16 @@ class Order extends Base
|
||||
$user = $this->auth->getUser();//登录用户
|
||||
if($user)$user_id = $user['id'];
|
||||
$activity_id = $this->request->post('activity_id/d', 0); //课程id
|
||||
// $num = $this->request->post('num/d', 0); //想同时约的课时id
|
||||
$num = 0; //想同时约的课时id
|
||||
$num = $this->request->post('num/d', 0); //想同时约的课时id
|
||||
// $num = 0; //想同时约的课时id
|
||||
|
||||
$param = [];
|
||||
|
||||
$people = urldecode($this->request->post('people/s', "{}") ?: "{}"); //参数
|
||||
// if($people){
|
||||
$param["people"] = json_decode($people,true);
|
||||
$num = count($param["people"]);
|
||||
$param["people"] = json_decode($people,true) ?: [];
|
||||
// var_dump($param["people"]);die;
|
||||
// $num = count($param["people"]);
|
||||
|
||||
// }
|
||||
|
||||
|
@ -100,6 +100,11 @@ class Order extends Base
|
||||
//当前申请状态
|
||||
$res = $this->model::workList($user_id,$page, $limit,$keywords,$status,$activity_id,$this->activity_ids,0,$server_status,$params);
|
||||
// var_dump($this->model->getLastSql());
|
||||
$res['activity_info'] = null;
|
||||
if($activity_id){
|
||||
$res['activity_info'] = (new \app\common\model\school\activity\Activity)->getActivityPeopleInfo($activity_id);
|
||||
}
|
||||
|
||||
}catch (\Exception $e){
|
||||
|
||||
$this->error($e->getMessage());
|
||||
|
@ -76,6 +76,12 @@ class Activity extends BaseModel
|
||||
return $imagesArray;
|
||||
}
|
||||
|
||||
public function getImageAttr($value, $data)
|
||||
{
|
||||
if (!empty($value)) return cdnurl($value,true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1000,6 +1006,9 @@ class Activity extends BaseModel
|
||||
$self['is_collect'] = 0;
|
||||
//是否购买
|
||||
$self['have_buy'] = 0;
|
||||
//是否是拥有者
|
||||
$self['is_owner'] = $self['user_id'] == $user_id ? 1 : 0;
|
||||
|
||||
if($user_id){
|
||||
//判断是否收藏
|
||||
$self['is_collect'] = Collect::where("user_id",$user_id)->where("classes_activity_id",$id)->count() ? 1:0 ;
|
||||
@ -1009,6 +1018,15 @@ class Activity extends BaseModel
|
||||
->where("user_id",$user_id)
|
||||
->where("status","not in",["-3","6","9"])
|
||||
->count() ? 1 : 0 ;
|
||||
//即非购买者,也非拥有者,则隐藏图片字段
|
||||
if(!$self['have_buy'] && $self["user_id"] != $user_id){
|
||||
//隐藏敏感字段
|
||||
$self["image"] = null;
|
||||
}
|
||||
|
||||
}else{
|
||||
//隐藏敏感字段
|
||||
$self["image"] = null;
|
||||
}
|
||||
|
||||
//
|
||||
@ -1402,10 +1420,14 @@ class Activity extends BaseModel
|
||||
*/
|
||||
public static function getSomePeople($id,$limit=3)
|
||||
{
|
||||
$as = (new OrderCode)->getWithAlisaName();
|
||||
$peoples = OrderCode::with("activityorder")
|
||||
->where("activityorder.status","not in", ['-3','0',"5","6"])
|
||||
->where("{$as}.activity_id",$id)
|
||||
->order("{$as}.id","desc")
|
||||
->limit($limit)->select();
|
||||
|
||||
$users = [];
|
||||
|
||||
return compact("users");
|
||||
return compact("peoples");
|
||||
}
|
||||
|
||||
|
||||
@ -1619,4 +1641,61 @@ class Activity extends BaseModel
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/** 编辑入群二维码
|
||||
* @param $image
|
||||
* @param $trans
|
||||
* @return $this
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function editQrcode($user_id,$id,$image="",$trans=false){
|
||||
|
||||
$row = self::where("user_id",$user_id)->where("id",$id)->find();
|
||||
if (!$row) {
|
||||
throw new \Exception(__('No Results were found'));
|
||||
}
|
||||
|
||||
//判断逻辑
|
||||
if($trans){
|
||||
self::beginTrans();
|
||||
}
|
||||
$res = true;
|
||||
try{
|
||||
|
||||
|
||||
$result = $row->allowField(true)->save([
|
||||
"image"=>$image
|
||||
]);
|
||||
|
||||
if($trans){
|
||||
self::commitTrans();
|
||||
}
|
||||
}catch (\Exception $e){
|
||||
if($trans){
|
||||
self::rollbackTrans();
|
||||
}
|
||||
throw new \Exception($e->getMessage().$e->getFile().$e->getLine());
|
||||
}
|
||||
return $row;
|
||||
}
|
||||
|
||||
|
||||
public function getActivityPeopleInfo($id){
|
||||
|
||||
$total_num = $sign_num = $verification_num = 0;
|
||||
$activity = self::where("id",$id)->find();
|
||||
if(!$activity) return compact("total_num","sign_num","verification_num");
|
||||
//活动总人数
|
||||
$total_num = $activity["stock"];
|
||||
//报名人数
|
||||
$sign_num = $activity["sign_num"];
|
||||
//核销人数
|
||||
$verification_num = $activity["verification_num"];
|
||||
return compact("total_num","sign_num","verification_num");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -294,8 +294,11 @@ class Join extends BaseModel
|
||||
$with_field = [
|
||||
'base'=>['*'],
|
||||
];
|
||||
$alisa = (new self)->getWithAlisaName();
|
||||
$sort = "{$alisa}.id desc";
|
||||
// $alisa = (new self)->getWithAlisaName();
|
||||
// $sort = "{$alisa}.id desc";
|
||||
|
||||
$sort = "id desc";
|
||||
|
||||
$serch_where = [];
|
||||
$serch_where = array_merge($serch_where,$params);
|
||||
return (new self)->getBaseList($serch_where, $page, $limit,$sort,$with_field);
|
||||
|
@ -633,6 +633,12 @@ class Order extends BaseModel
|
||||
}
|
||||
}
|
||||
|
||||
$people_num = count($param["people"]?? []) ;
|
||||
//人数与参与数量需对上
|
||||
if($people_num != $num){
|
||||
throw new \Exception("请选择正确的报名人数!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -666,6 +672,7 @@ class Order extends BaseModel
|
||||
}
|
||||
|
||||
|
||||
|
||||
// $activity_info['use_num'] = 0;//已使用课时
|
||||
// $activity_info['sub_num'] = $activity_info['classes_num'];//剩余课时
|
||||
// //单价 = 课程价格/总课时
|
||||
@ -983,6 +990,7 @@ class Order extends BaseModel
|
||||
self::beginTrans();
|
||||
}
|
||||
try {
|
||||
// var_dump($orderInfo['param']);die;
|
||||
//'classes_activity_id','classes_activity_item_id'
|
||||
//1订单执行创建
|
||||
$order = $this->createOrder($user_id,$orderInfo['activity_id'],$orderInfo['num'],$order_no,$orderInfo['param'],$remark);
|
||||
|
@ -85,7 +85,7 @@ class OrderCode extends BaseModel
|
||||
}
|
||||
|
||||
|
||||
public function order()
|
||||
public function activityorder()
|
||||
{
|
||||
return $this->belongsTo(Order::class, 'activity_order_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
@ -43,6 +43,9 @@ define(['jquery', 'bootstrap', 'backend', 'csmtable', 'form'], function ($, unde
|
||||
{field: 'platform', title: __('Platform'), searchList: platformListJson, formatter: Table.api.formatter.flag},
|
||||
{field: 'show', title: __('Show'), searchList: {"1":__('Show 1'),"2":__('Show 2')}, formatter: Table.api.formatter.status},
|
||||
{field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3'),"4":__('Status 4'),"5":__('Status 5'),"-1":__('Status -1')}, formatter: Table.api.formatter.status},
|
||||
|
||||
{field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
|
||||
{field: 'auth_status', title: __('Auth_status'), searchList: {"0":__('Auth_status 0'),"1":__('Auth_status 1'),"2":__('Auth_status 2')}, formatter: Table.api.formatter.status},
|
||||
{field: 'reason', title: __('Reason'), operate: 'LIKE'},
|
||||
|
||||
|
@ -60,6 +60,10 @@ define(['jquery', 'bootstrap', 'backend', 'csmtable', 'form'], function ($, unde
|
||||
{field: 'num', title: __('购买人数'), operate:'BETWEEN'},
|
||||
{field: 'detail.price', title: __('购买单价'), operate:'BETWEEN'},
|
||||
|
||||
|
||||
{field: 'desc', title: __('下单备注'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
|
||||
|
||||
{field: 'payprice', title: __('Payprice'), operate:'BETWEEN'},
|
||||
{field: 'pay_type', title: __('Pay_type'), searchList: {"yue":__('Pay_type yue'),"wechat":__('Pay_type wechat')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'before_status',visible:false, title: __('Before_status'), searchList: {"-3":__('Before_status -3'),"0":__('Before_status 0'),"2":__('Before_status 2'),"3":__('Before_status 3'),"4":__('Before_status 4'),"6":__('Before_status 6'),"9":__('Before_status 9')}, formatter: Table.api.formatter.status},
|
||||
|
@ -30,6 +30,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'activity_order_id', title: __('Activity_order_id')},
|
||||
|
||||
{field: 'name', title: __('姓名'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
|
||||
{field: 'idnum', title: __('身份证号'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
|
||||
|
||||
|
||||
{field: 'code', title: __('Code'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
|
||||
{field: 'miniurl', title: __('核销码内容'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
|
Loading…
x
Reference in New Issue
Block a user