1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- namespace app\api\controller;
- class Pintuan extends MobileMall
- {
- public function initialize()
- {
- parent::initialize();
- }
-
- public function index()
- {
- $ppintuan_model = model('ppintuan');
- $goods_model = model('goods');
- $condition = array(
- array('pintuan_state', '=', 1),
- array('pintuan_starttime', '<', TIMESTAMP),
- array('pintuan_end_time', '>', TIMESTAMP),
- );
- $pintuan_list = $ppintuan_model->getPintuanList($condition, 10, 'pintuan_state desc, pintuan_end_time desc');
- foreach ($pintuan_list as $key => $pintuan) {
- $goods_info = $goods_model->getGoodsInfoByID($pintuan['pintuan_goods_id']);
- if (!$goods_info || $goods_info['goods_state'] != 1 || $goods_info['goods_verify'] != 1) {
- unset($pintuan_list[$key]);
- continue;
- }
- $pintuan_list[$key]['pintuan_image'] = goods_cthumb($pintuan['pintuan_image'], 240);
- $pintuan_list[$key]['pintuan_zhe_price'] = round($pintuan['pintuan_goods_price'] * $pintuan['pintuan_zhe'] / 10, 2);
- }
- $page_count = $ppintuan_model->page_info;
- $result = array_merge(array('pintuan_list' => $pintuan_list,), mobile_page($page_count));
- ds_json_encode(10000, '', $result);
- }
- }
|