PointsController.class.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824
  1. <?php
  2. /**
  3. * lionfish 商城系统
  4. *
  5. * ==========================================================================
  6. * @link http://www.liofis.com/
  7. * @copyright Copyright (c) 2015 liofis.com.
  8. * @license http://www.liofis.com/license.html License
  9. * ==========================================================================
  10. *
  11. * @author fish
  12. *
  13. */
  14. namespace Seller\Controller;
  15. class PointsController extends CommonController{
  16. protected function _initialize(){
  17. parent::_initialize();
  18. }
  19. public function goods()
  20. {
  21. $pindex = I('get.page', 1);
  22. $psize = 20;
  23. $starttime_arr = I('get.time');
  24. $starttime = isset($starttime_arr['start']) ? strtotime($starttime_arr['start']) : strtotime(date('Y-m-d'.' 00:00:00'));
  25. $endtime = isset($starttime_arr['end']) ? strtotime($starttime_arr['end']) : strtotime(date('Y-m-d'.' 23:59:59'));
  26. $this->starttime = $starttime;
  27. $this->endtime = $endtime;
  28. $searchtime = I('get.searchtime','');
  29. $this->searchtime = $searchtime;
  30. $shop_data = array();
  31. $type = I('get.type','all');
  32. //---begin
  33. $count_common_where ="";
  34. if (defined('ROLE') && ROLE == 'agenter' ) {
  35. $supper_info = get_agent_logininfo();
  36. $supper_goods_list = M('lionfish_comshop_good_common')->field('goods_id')->where( array('supply_id' =>$supper_info['id'] ) )->select();
  37. $gids_list = array();
  38. foreach($supper_goods_list as $vv)
  39. {
  40. $gids_list[] = $vv['goods_id'];
  41. }
  42. if( !empty($gids_list) )
  43. {
  44. $count_common_where = " and id in ( ".implode(',', $gids_list )." )";
  45. }else{
  46. $count_common_where = " and id in (0)";
  47. }
  48. }
  49. $all_count = D('Seller/Goods')->get_goods_count(" and type = 'integral' {$count_common_where}");//全部商品数量
  50. $onsale_count = D('Seller/Goods')->get_goods_count(" and grounding = 1 and type = 'integral' {$count_common_where}");//出售中商品数量
  51. $getdown_count = D('Seller/Goods')->get_goods_count(" and grounding = 0 and type = 'integral' {$count_common_where}");//已下架商品数量
  52. $warehouse_count = D('Seller/Goods')->get_goods_count(" and grounding = 2 and type = 'integral' {$count_common_where}");//仓库商品数量
  53. $recycle_count = D('Seller/Goods')->get_goods_count(" and grounding = 3 and type = 'integral' {$count_common_where}");//回收站商品数量
  54. $waishen_count = D('Seller/Goods')->get_goods_count(" and grounding = 4 and type = 'integral' {$count_common_where}");//审核商品数量
  55. $unsuccshen_count = D('Seller/Goods')->get_goods_count(" and grounding = 5 and type = 'integral' {$count_common_where}");//拒绝审核商品数量
  56. $this->assign('waishen_count',$waishen_count);
  57. $this->assign('unsuccshen_count',$unsuccshen_count);
  58. //recycle 仓库
  59. //--end
  60. //recycle 仓库 get_config_by_name($name)
  61. $goods_stock_notice = D('Home/Front')->get_config_by_name('goods_stock_notice');
  62. $goods_stock_notice = intval($goods_stock_notice);
  63. if( empty($goods_stock_notice) )
  64. {
  65. $goods_stock_notice = 0;
  66. }
  67. $stock_notice_count = D('Admin/Goods')->get_goods_count(" and grounding = 1 and total<= {$goods_stock_notice} and type = 'integral' {$count_common_where} ");//回收站商品数量
  68. //goods_stock_notice
  69. //grounding 1
  70. //type all 全部
  71. //saleon 1 出售中
  72. //getdown 0 已下架
  73. //warehouse 2 仓库中
  74. //recycle 3 回收站
  75. $psize = 20;
  76. $condition = ' WHERE g.type = "integral" ';
  77. $sqlcondition = "";
  78. if( !empty($type) && $type != 'all')
  79. {
  80. switch($type)
  81. {
  82. case 'saleon':
  83. $condition .= " and g.grounding = 1";
  84. break;
  85. case 'getdown':
  86. $condition .= " and g.grounding = 0";
  87. break;
  88. case 'warehouse':
  89. $condition .= " and g.grounding = 2";
  90. break;
  91. case 'wait_shen':
  92. $condition .= " and g.grounding = 4";
  93. break;
  94. case 'refuse':
  95. $condition .= " and g.grounding = 5";
  96. break;
  97. case 'recycle':
  98. $condition .= " and g.grounding = 3";
  99. break;
  100. case 'stock_notice':
  101. $condition .= " and g.grounding = 1 and g.total<= {$goods_stock_notice} ";
  102. break;
  103. }
  104. }else{
  105. $condition .= " and g.grounding != 3 ";
  106. }
  107. $keyword = I('get.keyword','','addslashes');
  108. $keyword2 = stripslashes($keyword);
  109. $this->keyword = $keyword2;
  110. if (!(empty($keyword))) {
  111. $condition .= " AND (g.`id` = '{$keyword}' or g.`goodsname` LIKE '%{$keyword}%' or g.`codes` LIKE '%{$keyword}%' ) ";
  112. }
  113. if (defined('ROLE') && ROLE == 'agenter' )
  114. {
  115. $supper_info = get_agent_logininfo();
  116. $sqlcondition .= ' , ' . C('DB_PREFIX'). 'lionfish_comshop_good_common as gm ';
  117. $condition .= ' and gm.goods_id =g.id AND gm.supply_id ='.$supper_info['id'].' ';
  118. }
  119. if( !empty($searchtime) )
  120. {
  121. switch( $searchtime )
  122. {
  123. case 'create':
  124. $condition .= ' AND (gm.begin_time >='.$starttime.' and gm.end_time < '.$endtime.' )';
  125. if (!defined('ROLE') && ROLE != 'agenter' )
  126. {
  127. $sqlcondition .= ' left join ' . C('DB_PREFIX'). 'lionfish_comshop_good_common as gm on gm.goods_id = g.id ';
  128. }
  129. break;
  130. }
  131. }
  132. $cate = I('get.cate', '');
  133. $this->cate = $cate;
  134. if( !empty($cate) )
  135. {
  136. $cate_list = M('lionfish_comshop_goods_to_category')->field('goods_id')->where(array('cate_id' => $cate))->select();
  137. $catids_arr = array();
  138. foreach($cate_list as $val)
  139. {
  140. $catids_arr[] = $val['goods_id'];
  141. }
  142. if( !empty($catids_arr) )
  143. {
  144. $catids_str = implode(',', $catids_arr);
  145. $condition .= ' and g.id in ('.$catids_str.')';
  146. }else{
  147. $condition .= " and 1=0 ";
  148. }
  149. }
  150. $sql = 'SELECT COUNT(g.id) as count FROM ' .C('DB_PREFIX'). 'lionfish_comshop_goods g ' .$sqlcondition. $condition ;
  151. $total_arr = M()->query($sql);
  152. $total = $total_arr[0]['count'];
  153. $pager = pagination2($total, $pindex, $psize);
  154. if (!(empty($total))) {
  155. $sql = 'SELECT g.* FROM ' .C('DB_PREFIX'). 'lionfish_comshop_goods g ' .$sqlcondition . $condition . '
  156. ORDER BY g.istop DESC, g.settoptime DESC, g.`id` DESC ';
  157. $sql .= ' limit ' . (($pindex - 1) * $psize) . ',' . $psize;
  158. $list = M()->query($sql);
  159. foreach ($list as $key => &$value ) {
  160. $price_arr = D('Home/Pingoods')->get_goods_price($value['id']);
  161. $value['price_arr'] = $price_arr;
  162. $thumb = M('lionfish_comshop_goods_images')->where( array('goods_id' => $value['id']) )->order('id asc')->find();
  163. if( empty($thumb['thumb']) )
  164. {
  165. $value['thumb'] = $thumb['image'];
  166. }else{
  167. $value['thumb'] = $thumb['thumb'];
  168. }
  169. //is_take_fullreduction
  170. $gd_common = M('lionfish_comshop_good_common')->field('is_take_fullreduction,supply_id')->where( array('goods_id' => $value['id']) )->find();
  171. $value['is_take_fullreduction'] = $gd_common['is_take_fullreduction'];
  172. $value['supply_name'] = '';
  173. if( empty($gd_common['supply_id']) || $gd_common['supply_id'] ==0 )
  174. {
  175. $value['supply_id'] = 0;
  176. }else{
  177. $value['supply_id'] = $gd_common['supply_id'];
  178. $sub_info = M('lionfish_comshop_supply')->field('name')->where( array('id' => $gd_common['supply_id'] ) )->find();
  179. $value['supply_name'] = $sub_info['name'];
  180. }
  181. $categorys = M('lionfish_comshop_goods_to_category')->where( array('goods_id' => $value['id']) )->order('id asc')->select();
  182. $value['cate'] = $categorys;
  183. $time_info = D('home/front')->get_goods_common_field($value['id'] , 'begin_time,end_time');
  184. $value['begin_time'] = $time_info['begin_time'];
  185. $value['end_time'] = $time_info['end_time'];
  186. //团长数量
  187. $head_count = 0;
  188. if( $value['is_all_sale'] == 1 )
  189. {
  190. $head_count = M('lionfish_community_head')->count();
  191. }else{
  192. $head_count = M('lionfish_community_head_goods')->where( array('goods_id' => $value['id'] ) )->count();
  193. }
  194. $value['head_count'] = $head_count;
  195. }
  196. }
  197. $categorys = D('Seller/GoodsCategory')->getFullCategory(true,false,'pintuan');
  198. $category = array();
  199. foreach ($categorys as $cate ) {
  200. $category[$cate['id']] = $cate;
  201. }
  202. $this->category =$category;
  203. $this->type = $type;
  204. $this->all_count = $all_count;
  205. $this->onsale_count = $onsale_count;
  206. $this->getdown_count = $getdown_count;
  207. $this->warehouse_count = $warehouse_count;
  208. $this->recycle_count = $recycle_count;
  209. $this->stock_notice_count = $stock_notice_count;
  210. $this->assign('list',$list);// 赋值数据集
  211. $this->assign('pager',$pager);// 赋值分页输出
  212. $is_open_fullreduction = 0;
  213. $this->assign('is_open_fullreduction',$is_open_fullreduction);
  214. $index_sort_method = D('Home/Front')->get_config_by_name('index_sort_method');
  215. if( empty($index_sort_method) || $index_sort_method == 0 )
  216. {
  217. $index_sort_method = 0;
  218. }
  219. $this->index_sort_method = $index_sort_method;
  220. //---
  221. $supply_add_goods_shenhe = D('Home/Front')->get_config_by_name('supply_add_goods_shenhe');
  222. $supply_edit_goods_shenhe = D('Home/Front')->get_config_by_name('supply_edit_goods_shenhe');
  223. $supply_add_goods_shenhe = 0;
  224. $supply_edit_goods_shenhe = 0;
  225. $is_open_shenhe = 0;
  226. $this->supply_add_goods_shenhe = $supply_add_goods_shenhe;
  227. $this->supply_edit_goods_shenhe = $supply_edit_goods_shenhe;
  228. $this->assign('is_open_shenhe',$is_open_shenhe);
  229. //--
  230. //团长分组
  231. $group_default_list = array(
  232. array('id' => 'default', 'groupname' => '默认分组')
  233. );
  234. $this->group_list = array();
  235. $config_data = D('Seller/Config')->get_all_config();
  236. $pintuan_model_buy = 0;
  237. $this->pintuan_model_buy = $pintuan_model_buy;
  238. //团长分组
  239. $group_default_list = array(
  240. array('id' => 'default', 'groupname' => '默认分组')
  241. );
  242. $this->group_list = $group_list;
  243. $is_index = false;
  244. $is_top = false;
  245. $is_updown = false;
  246. $is_fullreduce = false;
  247. $is_vir_count = false;
  248. $is_newbuy = false;
  249. $is_goodsspike = false;
  250. $this->config_data = $config_data;
  251. $this->is_index = $is_index;
  252. $this->is_top = $is_top;
  253. $this->is_updown = $is_updown;
  254. $this->is_fullreduce = $is_fullreduce;
  255. $this->is_vir_count = $is_vir_count;
  256. $this->is_newbuy = $is_newbuy;
  257. $this->is_goodsspike = $is_goodsspike;
  258. $this->display();
  259. }
  260. public function editgoods()
  261. {
  262. $id = I('get.id');
  263. if (IS_POST) {
  264. $_GPC = I('post.');
  265. if( !isset($_GPC['thumbs']) || empty($_GPC['thumbs']) )
  266. {
  267. show_json(0, array('message' => '商品图片必须上传' ,'url' => $_SERVER['HTTP_REFERER']) );
  268. die();
  269. }
  270. D('Seller/Goods')->modify_goods('integral');
  271. $http_refer = S('HTTP_REFERER');
  272. $http_refer = empty($http_refer) ? $_SERVER['HTTP_REFERER'] : $http_refer;
  273. show_json(1, array('message'=>'修改商品成功!','url' => $http_refer ));
  274. }
  275. //sss
  276. S('HTTP_REFERER', $_SERVER['HTTP_REFERER']);
  277. $this->id = $id;
  278. $item = D('Seller/Goods')->get_edit_goods_info($id,0);
  279. //-------------------------以上是获取资料
  280. $limit_goods = array();
  281. $this->limit_goods = $limit_goods;
  282. $category = D('Seller/GoodsCategory')->getFullCategory(true, true);
  283. $this->category = $category;
  284. $spec_list = D('Seller/Spec')->get_all_spec();
  285. $this->spec_list = $spec_list;
  286. $dispatch_data = M('lionfish_comshop_shipping')->where( array('enabled' => 1, 'isdefault' => 1) )->order('sort_order desc')->select();
  287. $this->dispatch_data = $dispatch_data;
  288. $set = D('Seller/Config')->get_all_config();
  289. $this->set = $set;
  290. $commission_level = array();
  291. $config_data = $set;
  292. $this->config_data = $config_data;
  293. $default = array('id' => 'default', 'levelname' => empty($config_data['commission_levelname']) ? '默认等级' : $config_data['commission_levelname'], 'commission1' => $config_data['commission1'], 'commission2' => $config_data['commission2'], 'commission3' => $config_data['commission3']);
  294. //$others = pdo_fetchall('SELECT * FROM ' . tablename('lionfish_comshop_commission_level') . ' WHERE uniacid = \'' . $_W['uniacid'] . '\' ORDER BY commission1 asc');
  295. //$commission_level = array_merge(array($default), $others);
  296. $commission_level = array();
  297. //$level['key']
  298. foreach($commission_level as $key => $val)
  299. {
  300. $val['key'] = $val['id'];
  301. $commission_level[$key] = $val;
  302. }
  303. $shopset_level = empty($set['commiss_level']) ? 0: $set['commiss_level'];
  304. $this->shopset_level = $shopset_level;
  305. $open_buy_send_score = empty($set['open_buy_send_score']) ? 0: $set['open_buy_send_score'];
  306. $this->open_buy_send_score = $open_buy_send_score;
  307. $delivery_type_express = $config_data['delivery_type_express'];
  308. if( empty($delivery_type_express) )
  309. {
  310. $delivery_type_express = 2;
  311. }
  312. $this->delivery_type_express = $delivery_type_express;
  313. $is_open_fullreduction = $config_data['is_open_fullreduction'];
  314. $this->is_open_fullreduction = $is_open_fullreduction;
  315. $community_head_level = M('lionfish_comshop_community_head_level')->order('id asc')->select();
  316. $head_commission_levelname = $config_data['head_commission_levelname'];
  317. $default_comunity_money = $config_data['default_comunity_money'];
  318. $list_default = array(
  319. array('id' => '0','level'=>0,'levelname' => empty($head_commission_levelname) ? '默认等级' : $head_commission_levelname, 'commission' => $default_comunity_money, )
  320. );
  321. $community_head_level = array_merge($list_default, $community_head_level);
  322. $community_head_commission_info = D('Seller/Communityhead')->get_goods_head_level_bili( $id );
  323. $mb_level = M('lionfish_comshop_member_level')->count();
  324. $this->mb_level = $mb_level;
  325. if( !empty($community_head_commission_info) )
  326. {
  327. foreach( $community_head_commission_info as $kk => $vv)
  328. {
  329. $item[$kk] = $vv;
  330. }
  331. }
  332. $this->community_head_commission_info = $community_head_commission_info;
  333. $this->item = $item;
  334. $this->community_head_level = $community_head_level;
  335. //end
  336. $community_money_type = $config_data['community_money_type'];
  337. $this->community_money_type = $community_money_type;
  338. $index_sort_method = D('Home/Front')->get_config_by_name('index_sort_method');
  339. if( empty($index_sort_method) || $index_sort_method == 0 )
  340. {
  341. $index_sort_method = 0;
  342. }
  343. $this->index_sort_method = $index_sort_method;
  344. $is_open_only_express = $config_data['is_open_only_express'];
  345. $this->is_open_only_express = $is_open_only_express;
  346. $is_open_goods_relative_goods = 0;
  347. $this->is_open_goods_relative_goods = $is_open_goods_relative_goods;
  348. //供应商权限begin
  349. $is_index = true;
  350. $is_top = true;
  351. $is_updown = true;
  352. $is_fullreduce = true;
  353. $is_vir_count = true;
  354. $is_newbuy = true;
  355. $is_goodsspike = true;
  356. //供应商权限end
  357. $this->is_index = $is_index;
  358. $this->is_top = $is_top;
  359. $this->is_updown = $is_updown;
  360. $this->is_fullreduce = $is_fullreduce;
  361. $this->is_vir_count = $is_vir_count;
  362. $this->is_newbuy = $is_newbuy;
  363. $this->is_goodsspike = $is_goodsspike;
  364. $pintuan_model_buy = 0;
  365. //供应商权限begin community_head_level
  366. $this->pintuan_model_buy = $pintuan_model_buy;
  367. $this->display('Points/addgoods');
  368. }
  369. public function addgoods()
  370. {
  371. if (IS_POST) {
  372. $_GPC = I('request.');
  373. if( !isset($_GPC['thumbs']) || empty($_GPC['thumbs']) )
  374. {
  375. show_json(0, array('message' => '商品图片必须上传' ,'url' => $_SERVER['HTTP_REFERER']) );
  376. die();
  377. }
  378. D('Seller/Goods')->addgoods('integral');
  379. $http_refer = S('HTTP_REFERER');
  380. $http_refer = empty($http_refer) ? $_SERVER['HTTP_REFERER'] : $http_refer;
  381. show_json(1, array('message' => '添加商品成功!','url' => $http_refer ));
  382. }
  383. S('HTTP_REFERER', $_SERVER['HTTP_REFERER']);
  384. $this->category = array();
  385. $spec_list = D('Seller/Spec')->get_all_spec();
  386. $this->spec_list = $spec_list;
  387. $dispatch_data = M('lionfish_comshop_shipping')->where( array('enabled' => 1,'isdefault' =>1) )->order('sort_order desc')->select();
  388. $this->dispatch_data = $dispatch_data;
  389. $set = D('Seller/Config')->get_all_config();
  390. $commission_level = array();
  391. $config_data = $set;
  392. $this->config_data = $config_data;
  393. $default = array('id' => 'default', 'levelname' => empty($config_data['commission_levelname']) ? '默认等级' : $config_data['commission_levelname'], 'commission1' => $config_data['commission1'], 'commission2' => $config_data['commission2'], 'commission3' => $config_data['commission3']);
  394. $others = M('lionfish_comshop_commission_level')->order('commission1 asc')->select();
  395. $commission_level = array_merge(array($default), $others);
  396. $communityhead_commission = $config_data['default_comunity_money'];
  397. $this->communityhead_commission = $communityhead_commission;
  398. //$level['key']
  399. foreach($commission_level as $key => $val)
  400. {
  401. $val['key'] = $val['id'];
  402. $commission_level[$key] = $val;
  403. }
  404. $this->commission_level = $commission_level;
  405. $shopset_level = empty($set['commiss_level']) ? 0: $set['commiss_level'];
  406. $this->shopset_level = $shopset_level;
  407. $open_buy_send_score = empty($set['open_buy_send_score']) ? 0: $set['open_buy_send_score'];
  408. $this->open_buy_send_score = $open_buy_send_score;
  409. $item = array();
  410. $item['begin_time'] = time();
  411. $item['community_head_commission'] = $communityhead_commission;
  412. $item['end_time'] = time() + 86400;
  413. $delivery_type_express = $config_data['delivery_type_express'];
  414. if( empty($delivery_type_express) )
  415. {
  416. $delivery_type_express = 2;
  417. }
  418. $this->delivery_type_express = $delivery_type_express;
  419. $is_open_fullreduction = $config_data['is_open_fullreduction'];
  420. $this->is_open_fullreduction = $is_open_fullreduction;
  421. $community_head_level = M('lionfish_comshop_community_head_level')->order('id asc')->select();
  422. $head_commission_levelname = $config_data['head_commission_levelname'];
  423. $default_comunity_money = $config_data['default_comunity_money'];
  424. $list_default = array(
  425. array('id' => '0','level'=>0,'levelname' => empty($head_commission_levelname) ? '默认等级' : $head_commission_levelname, 'commission' => $default_comunity_money, )
  426. );
  427. $community_head_level = array_merge($list_default, $community_head_level);
  428. if( !empty($community_head_level) )
  429. {
  430. foreach( $community_head_level as $head_level)
  431. {
  432. $item['head_level'.$head_level['id']] = $head_level['commission'];
  433. }
  434. }
  435. $this->item = $item;
  436. $this->community_head_level = $community_head_level;
  437. $community_money_type = $config_data['community_money_type'];
  438. $this->community_money_type = $community_money_type;
  439. $mb_level = M('lionfish_comshop_member_level')->count();
  440. $this->mb_level = $mb_level;
  441. $is_open_only_express = $config_data['is_open_only_express'];
  442. $this->is_open_only_express = $is_open_only_express;
  443. $is_open_goods_relative_goods = $config_data['is_open_goods_relative_goods'];
  444. $this->is_open_goods_relative_goods = $is_open_goods_relative_goods;
  445. //供应商权限begin
  446. $is_index = true;
  447. $is_top = true;
  448. $is_updown = true;
  449. $is_fullreduce = true;
  450. $is_vir_count = true;
  451. $is_newbuy = true;
  452. $is_goodsspike = true;
  453. //供应商权限end
  454. $this->is_index = $is_index;
  455. $this->is_top = $is_top;
  456. $this->is_updown = $is_updown;
  457. $this->is_fullreduce = $is_fullreduce;
  458. $this->is_vir_count = $is_vir_count;
  459. $this->is_newbuy = $is_newbuy;
  460. $this->is_goodsspike = $is_goodsspike;
  461. $pintuan_model_buy = isset($config_data['pintuan_model_buy']) ? intval( $config_data['pintuan_model_buy'] ) : 0;
  462. $this->pintuan_model_buy = $pintuan_model_buy;
  463. $this->display();
  464. }
  465. public function order()//
  466. {
  467. $_GPC = I("request.");
  468. //dump($_GPC);
  469. //echo 777;
  470. $starttime = isset($_GPC['time']['start']) ? strtotime($_GPC['time']['start']) : strtotime(date('Y-m-d'.' 00:00:00'));
  471. $endtime = isset($_GPC['time']['end']) ? strtotime($_GPC['time']['end']) : strtotime(date('Y-m-d'.' 23:59:59'));
  472. $order_status_arr = D('Seller/Order')->get_order_status_name();
  473. $need_data = D('Seller/Order')->load_order_list(0,0,0,1);
  474. $cur_controller = 'points/order';
  475. $total = $need_data['total'];
  476. $total_money = $need_data['total_money'];
  477. $list = $need_data['list'];
  478. $pager = $need_data['pager'];
  479. $all_count = $need_data['all_count'];
  480. $count_status_1 = $need_data['count_status_1'];
  481. $count_status_3 = $need_data['count_status_3'];
  482. $count_status_4 = $need_data['count_status_4'];
  483. $count_status_5 = $need_data['count_status_5'];
  484. $count_status_7 = $need_data['count_status_7'];
  485. $count_status_11 = $need_data['count_status_11'];
  486. $count_status_14 = $need_data['count_status_14'];
  487. $open_feier_print = D('Home/Front')->get_config_by_name('open_feier_print');
  488. if( empty($open_feier_print) )
  489. {
  490. $open_feier_print = 0;
  491. }
  492. $is_can_look_headinfo = true;
  493. $is_can_nowrfund_order = true;
  494. $this->starttime = $starttime;
  495. $this->endtime = $endtime;
  496. $this->searchtime = $_GPC['searchtime'];
  497. $this->keyword = $_GPC['keyword'];
  498. $this->endtime = $endtime;
  499. $this->cur_controller = $cur_controller;
  500. $this->total = $total;
  501. $this->total_money = $total_money;
  502. $this->list = $list;
  503. $this->pager = $pager;
  504. $this->all_count = $all_count;
  505. $this->count_status_1 = $count_status_1;
  506. $this->count_status_3 = $count_status_3;
  507. $this->count_status_4 = $count_status_4;
  508. $this->count_status_5 = $count_status_5;
  509. $this->count_status_7 = $count_status_7;
  510. $this->count_status_11 = $count_status_11;
  511. $this->count_status_14 = $count_status_14;
  512. $s_id = 1 ;
  513. if(SELLERUID != 1)
  514. {
  515. $seller_info = M('seller')->field('s_role_id')->where( array('s_id' => SELLERUID ) )->find();
  516. $perms_arr = M('lionfish_comshop_perm_role')->where( array('id' => $seller_info['s_role_id']) )->find();
  517. $perms1 = str_replace('.','/',$perms_arr['perms2']);
  518. $perms2 = explode(",", $perms1);
  519. if(in_array("user/user/index", $perms2)){
  520. $s_id = 1 ;
  521. } else {
  522. $s_id = 0 ;
  523. }
  524. }
  525. $this->s_id = $s_id;
  526. $supply_can_look_headinfo = D('Home/Front')->get_config_by_name('supply_can_look_headinfo');
  527. $supply_can_nowrfund_order = D('Home/Front')->get_config_by_name('supply_can_nowrfund_order');
  528. $this->open_feier_print = $open_feier_print;
  529. $this->supply_can_look_headinfo = $supply_can_look_headinfo;
  530. $this->supply_can_nowrfund_order = $supply_can_nowrfund_order;
  531. $this->_GPC = $_GPC;
  532. $this->cur_controller = $cur_controller;
  533. $this->display();
  534. }
  535. }
  536. ?>