正在显示
1 个修改的文件
包含
108 行增加
和
0 行删除
@@ -64,4 +64,112 @@ class PortalController extends Controller | @@ -64,4 +64,112 @@ class PortalController extends Controller | ||
64 | Db::name('money_log')->insert(['type'=>2,'create_time'=>time(),'user_id'=>$user['id'],'money'=>$param['money'],'now_money'=>($user['money']-$param['money'])]); | 64 | Db::name('money_log')->insert(['type'=>2,'create_time'=>time(),'user_id'=>$user['id'],'money'=>$param['money'],'now_money'=>($user['money']-$param['money'])]); |
65 | $this->success('操作成功'); | 65 | $this->success('操作成功'); |
66 | } | 66 | } |
67 | + | ||
68 | + /** | ||
69 | + * @title 订单列表种类 | ||
70 | + * @description | ||
71 | + * @author panhaowen | ||
72 | + * @url /portal/portal/Order | ||
73 | + * @method POST | ||
74 | + */ | ||
75 | + public function Order() | ||
76 | + { | ||
77 | + $data=Db::name('category')->select(); | ||
78 | + $this->success('获取信息成功',$data); | ||
79 | + } | ||
80 | + | ||
81 | + | ||
82 | + /** | ||
83 | + * @title 营销订单查看(审核中),营销订单修改 | ||
84 | + * @description | ||
85 | + * @author panhaowen | ||
86 | + * @url /portal/portal/MarketOrder1 | ||
87 | + * @method POST | ||
88 | + * @param name:id type:int require:1 desc:营销订单id | ||
89 | + */ | ||
90 | + public function MarketOrder1() | ||
91 | + { | ||
92 | + $param=$this->request->param(); | ||
93 | + $data=cmf_get_file_download_url(Db::name('market_order')->where('id',$param['id'])->find()['more']); | ||
94 | + $this->success('获取信息成功',$data); | ||
95 | + } | ||
96 | + | ||
97 | + /** | ||
98 | + * @title 营销订单查看(已发布) | ||
99 | + * @description | ||
100 | + * @author panhaowen | ||
101 | + * @url /portal/portal/MarketOrder2 | ||
102 | + * @method POST | ||
103 | + * @param name:id type:int require:1 desc:营销订单id | ||
104 | + */ | ||
105 | + public function MarketOrder2() | ||
106 | + { | ||
107 | + $param=$this->request->param(); | ||
108 | + $data=Db::name('market_order')->where('id',$param['id'])->find(); | ||
109 | + if ($data['url']!=null) { | ||
110 | + $this->success('获取信息成功', $data['url']); | ||
111 | + } | ||
112 | + $this->success('获取信息成功', cmf_get_file_download_url($data['remark'])); | ||
113 | + } | ||
114 | + | ||
115 | + | ||
116 | + /** | ||
117 | + * @title 营销订单重投 | ||
118 | + * @description | ||
119 | + * @author panhaowen | ||
120 | + * @url /portal/portal/MarketOrderRe | ||
121 | + * @method POST | ||
122 | + * @param name:id type:int require:1 desc:营销订单id | ||
123 | + * @param name:file type:varchar require:1 desc:文件上传 | ||
124 | + */ | ||
125 | + public function MarketOrderRe() | ||
126 | + { | ||
127 | + $param=$this->request->param(); | ||
128 | + $user=$this->getUser(); | ||
129 | + $order=Db::name('market_order')->where('id',$param['id'])->find(); | ||
130 | + if ($user['money']<$order['money']){ | ||
131 | + $this->error('账户余额不足'); | ||
132 | + } | ||
133 | + Db::name('market_order')->insert(['market_business_id'=>$order['market_business_id'],'create_time'=>time(),'order_sn'=>cmf_get_order_sn(),'more'=>$param['file'],'money'=>$order['money'],'user_id'=>$user['id']]); | ||
134 | + Db::name('user')->where('id',$user['id'])->setDec('money',$order['money']); | ||
135 | + Db::name('money_log')->insert(['type'=>3,'create_time'=>time(),'user_id'=>$user['id'],'money'=>$order['money'],'now_money'=>($user['money']-$order['money'])]); | ||
136 | + $this->success('操作成功'); | ||
137 | + } | ||
138 | + | ||
139 | + /** | ||
140 | + * @title 新媒体订单查看内容 | ||
141 | + * @description | ||
142 | + * @author panhaowen | ||
143 | + * @url /portal/portal/BusinessOrder | ||
144 | + * @method POST | ||
145 | + * @param name:id type:int require:1 desc:新媒体订单id | ||
146 | + */ | ||
147 | + public function BusinessOrder() | ||
148 | + { | ||
149 | + $param=$this->request->param(); | ||
150 | + $data=Db::name('business_order')->where('id',$param['id'])->find(); | ||
151 | + if ($data['post_url']!=null) { | ||
152 | + $this->success('获取信息成功', $data['post_url']); | ||
153 | + } | ||
154 | + $this->success('获取信息成功', cmf_get_file_download_url($data['remark'])); | ||
155 | + } | ||
156 | + | ||
157 | + /** | ||
158 | + * @title 新媒体订单退款 | ||
159 | + * @description | ||
160 | + * @author panhaowen | ||
161 | + * @url /portal/portal/BusinessOrderReturn | ||
162 | + * @method POST | ||
163 | + * @param name:id type:int require:1 desc:新媒体订单id | ||
164 | + */ | ||
165 | + public function BusinessOrderReturn() | ||
166 | + { | ||
167 | + $param=$this->request->param(); | ||
168 | + $user=$this->getUser(); | ||
169 | + $order=Db::name('business_order')->where('id',$param['id'])->find(); | ||
170 | + Db::name('business_order')->where('id',$param['id'])->update(['status'=>3]); | ||
171 | + Db::name('user')->where('id',$user)->setInc('money',$order['money']); | ||
172 | + Db::name('money_log')->insert(['create_time'=>time(),'user_id'=>$user['id'],'money'=>$order['money'],'now_money'=>$user['money']+$order['money'],'type'=>5]); | ||
173 | + $this->success('操作成功'); | ||
174 | + } | ||
67 | } | 175 | } |
-
请 注册 或 登录 后发表评论