Sellergoodsadd.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. namespace app\api\controller;
  3. /**
  4. * ============================================================================
  5. * DSMall多用户商城
  6. * ============================================================================
  7. * 版权所有 2014-2028 长沙德尚网络科技有限公司,并保留所有权利。
  8. * 网站地址: http://www.csdeshang.com
  9. * ----------------------------------------------------------------------------
  10. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用 .
  11. * 不允许对程序代码以任何形式任何目的的再发布。
  12. * ============================================================================
  13. * 卖家商品控制器
  14. */
  15. class Sellergoodsadd extends MobileSeller {
  16. public function initialize() {
  17. parent::initialize(); // TODO: Change the autogenerated stub
  18. $this->obj = new Sellergoods($this->app);
  19. }
  20. /**
  21. * 三方店铺验证,商品数量,有效期
  22. */
  23. private function checkStore() {
  24. $goodsLimit = (int) $this->store_grade['storegrade_goods_limit'];
  25. if ($goodsLimit > 0) {
  26. // 是否到达商品数上限
  27. $goods_num = model('goods')->getGoodsCommonCount(array('store_id' => session('store_id')));
  28. if ($goods_num >= $goodsLimit) {
  29. ds_json_encode(10001, lang('store_goods_index_goods_limit') . $goodsLimit . lang('store_goods_index_goods_limit1'));
  30. }
  31. }
  32. }
  33. public function goods_class() {
  34. $this->obj->goods_class();
  35. }
  36. public function get_common_data() {
  37. $this->obj->get_common_data();
  38. }
  39. public function save_goods() {
  40. $this->checkStore();
  41. $this->obj->save_goods();
  42. }
  43. public function image_upload() {
  44. $this->obj->image_upload();
  45. }
  46. public function video_upload() {
  47. $this->obj->video_upload();
  48. }
  49. public function add_spec() {
  50. $this->obj->add_spec();
  51. }
  52. public function edit_image() {
  53. $this->obj->edit_image();
  54. }
  55. public function save_image() {
  56. $this->obj->save_image();
  57. }
  58. }
  59. ?>