StoreBindClassModel.class.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /**
  3. * 小梦科技资源nanodreamtech.com
  4. *
  5. * ==========================================================================
  6. * @link https://www.nanodreamtech.com/
  7. * @copyright Copyright (c) 2015 liofis.com.
  8. * @license https://www.nanodreamtech.com/license.html License
  9. * ==========================================================================
  10. *
  11. * @author fish
  12. *
  13. */
  14. namespace Admin\Model;
  15. class StoreBindClassModel{
  16. /**
  17. *显示分页
  18. */
  19. public function show_store_bind_class_page($seller_id){
  20. $sql="select * from ".C('DB_PREFIX')."store_bind_class where seller_id={$seller_id}";
  21. $count=count(M()->query($sql));
  22. $Page = new \Think\Page($count,C('BACK_PAGE_NUM'));
  23. $show = $Page->show();// 分页显示输出
  24. $sql.=' order by bid desc LIMIT '.$Page->firstRow.','.$Page->listRows;
  25. $list=M()->query($sql);
  26. return array(
  27. 'empty'=>'<tr><td colspan="20">~~暂无数据</td></tr>',
  28. 'list'=>$list,
  29. 'page'=>$show
  30. );
  31. }
  32. function add_bind_class($id)
  33. {
  34. return M('store_bind_class')->where( array('bid' => $id) )->delete();
  35. }
  36. function add_store_bind_class($data){
  37. return M('store_bind_class')->add($data);
  38. }
  39. function edit_seller_user($d){
  40. $d['s_passwd']=think_ucenter_encrypt($d['s_passwd'],C('SELLER_PWD_KEY'));
  41. $r=M('Seller')->where(array('s_id'=>$d['s_id']))->save($d);
  42. if($r){
  43. return array(
  44. 'status'=>'success',
  45. 'message'=>'修改成功',
  46. 'jump'=>U('SellerManage/index')
  47. );
  48. }else{
  49. return array(
  50. 'status'=>'fail',
  51. 'message'=>'修改失败',
  52. 'jump'=>U('SellerManage/index')
  53. );
  54. }
  55. }
  56. }
  57. ?>