| xqd
@@ -15,6 +15,7 @@ use basic\ModelBasic;
|
|
|
use traits\ModelTrait;
|
|
|
use app\admin\model\study\PlanBuy;
|
|
|
use app\admin\model\study\PlanItems;
|
|
|
+use app\wap\model\special\Special;
|
|
|
|
|
|
/**专题获得
|
|
|
* Class SpecialBuy
|
| xqd
@@ -123,6 +124,27 @@ class SpecialBuy extends ModelBasic
|
|
|
];
|
|
|
$planItems = PlanItems::alias('pt')->join($join)->where(['pt.cid'=>$special_id])->count();
|
|
|
$flag = $planItems ? true : false;
|
|
|
+ if ($flag) {
|
|
|
+ //将课程信息插入到specialbuy里面
|
|
|
+ $spinfo = Special::where(['id' => $special_id])->find();
|
|
|
+ $planItems = PlanItems::alias('pt')->join($join)->where(['pt.cid'=>$special_id])->find()->toArray();
|
|
|
+ if ($spinfo) {
|
|
|
+ $data = [
|
|
|
+ 'uid' => $uid,
|
|
|
+ 'order_id' => $planItems['orderid'],
|
|
|
+ 'column_id' => 0,
|
|
|
+ 'special_id' => $special_id,
|
|
|
+ 'type' => $planItems['type'],
|
|
|
+ 'is_del' => 0,
|
|
|
+ 'add_time' => time(),
|
|
|
+ 'validity_time' => 0,
|
|
|
+ 'planid' => $planItems['pid'],
|
|
|
+ 'planbuyid' => $planItems['id'],
|
|
|
+ ];
|
|
|
+ self::set($data);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
return $flag;
|
|
|
}
|