Saler.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php namespace Place_interface\Api;
  2. use Dever;
  3. use Place;
  4. use Place_interface\Lib\Core;
  5. use Place\Lib\Role;
  6. class Saler extends Core
  7. {
  8. protected $login = true;
  9. protected $entry = true;
  10. public function __construct()
  11. {
  12. parent::__construct();
  13. $this->role = new Role('saler', 2);
  14. }
  15. # 分销中心
  16. public function home()
  17. {
  18. $data = Dever::db('saler', 'place_user')->find(array('uid' => Place::$uid));
  19. return $data;
  20. }
  21. # 基本信息
  22. public function getList()
  23. {
  24. return $this->role->getList();
  25. }
  26. # 确认支付
  27. public function pay_confirm()
  28. {
  29. $id = Dever::input('id');
  30. if (!$id) {
  31. Dever::error('分销员不存在');
  32. }
  33. $info = $this->role->getList($id);
  34. if (!$info['list']) {
  35. Dever::error('分销员不存在');
  36. }
  37. $data = Dever::load('role/pay', 'place_order')->get($info['list']);
  38. $data['money'] = Place::money();
  39. return $data;
  40. }
  41. # 拉起支付
  42. public function pay()
  43. {
  44. $this->pay_confirm();
  45. return Dever::load('role/pay', 'place_order')->act();
  46. }
  47. }