|
@@ -5,13 +5,13 @@ use Dever;
|
|
# 必须登录才能购买小刊
|
|
# 必须登录才能购买小刊
|
|
class Buy extends Base
|
|
class Buy extends Base
|
|
{
|
|
{
|
|
- public function __construct()
|
|
|
|
|
|
+ public function __construct()
|
|
{
|
|
{
|
|
- parent::__construct();
|
|
|
|
|
|
+ parent::__construct();
|
|
|
|
|
|
- if (!$this->user) {
|
|
|
|
- //return $this->location('home');
|
|
|
|
- }
|
|
|
|
|
|
+ if (!$this->user) {
|
|
|
|
+ //return $this->location('home');
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
# 列表页
|
|
# 列表页
|
|
@@ -57,6 +57,26 @@ class Buy extends Base
|
|
|
|
|
|
# 列表页 我已购买的兑换码
|
|
# 列表页 我已购买的兑换码
|
|
public function lists_code()
|
|
public function lists_code()
|
|
|
|
+ {
|
|
|
|
+ $where['cate_id'] = $this->cate;
|
|
|
|
+ $where['create_uid'] = $this->user['id'];
|
|
|
|
+ //$where['type'] = 3;
|
|
|
|
+ $where['type'] = 4;
|
|
|
|
+ $data = Dever::db('code/info')->getAll($where);
|
|
|
|
+
|
|
|
|
+ if ($data) {
|
|
|
|
+ foreach ($data as $k => $v) {
|
|
|
|
+ $data[$k]['cdate'] = date('Y年m月d日 H:i', $v['cdate']);
|
|
|
|
+ $data[$k]['link'] = '';
|
|
|
|
+ $data[$k]['desc'] = $v['buy_num'] . '本 ¥' . number_format($v['cash'], 2);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return $data;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ # 列表页 我已购买的兑换码
|
|
|
|
+ public function code_detail()
|
|
{
|
|
{
|
|
$where['cate_id'] = $this->cate;
|
|
$where['cate_id'] = $this->cate;
|
|
$where['create_uid'] = $this->user['id'];
|
|
$where['create_uid'] = $this->user['id'];
|
|
@@ -285,7 +305,7 @@ class Buy extends Base
|
|
|
|
|
|
$order_data['system'] = 2;
|
|
$order_data['system'] = 2;
|
|
if ($this->source) {
|
|
if ($this->source) {
|
|
- $order_data['source'] = $this->source;
|
|
|
|
|
|
+ $order_data['source'] = $this->source;
|
|
}
|
|
}
|
|
|
|
|
|
if ($this->seller) {
|
|
if ($this->seller) {
|