PointsController.class.php 22 KB

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