作者 xieweiping
1 个管道 的构建 通过 耗费 0 秒

课表取消功能

... ... @@ -232,6 +232,7 @@ class Course extends Api
$store = [];
foreach($courseStore as $k){
if(!isset($store_id[$k['store_id']])){
$store_id[$k['store_id']] = $k['store_id'];
$store1 = new \app\admin\model\Store();
... ... @@ -242,6 +243,17 @@ class Course extends Api
$store1['course'] = [];
$store[$k['store_id']] = $store1;
}
}
foreach ($store_id as $v){
$courseStore = new \app\admin\model\CourseStore();
$where['course_id'] = $id;
$where['status'] = 'confirmed';
$where['store_id'] = $v;
$where['is_end'] = false;
$where['end'] = ['>',date('Y-m-d H:i:s')];
$courseStore = $courseStore->where($where)->order('date','asc')->select();
foreach ($courseStore as $k){
$k['enable'] = true;
... ... @@ -276,6 +288,8 @@ class Course extends Api
$k['sign_count'] = $sign->where(['course_store_id'=>$k['id']])->count();
$store[$k['store_id']]['course'][] = $k;
}
}
$course['store'] = array_values($store);
... ...