Sellergoodsadd.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. namespace app\api\controller;
  3. /**
  4. * ============================================================================
  5. *
  6. * ============================================================================
  7. * 版权所有 2014-2028 浙江惠利玛产业互联网有限公司,并保留所有权利。
  8. * 网站地址: https://www.valimart.net/
  9. * ----------------------------------------------------------------------------
  10. *
  11. * ============================================================================
  12. * 卖家商品控制器
  13. */
  14. class Sellergoodsadd extends MobileSeller {
  15. public function initialize() {
  16. parent::initialize(); // TODO: Change the autogenerated stub
  17. $this->obj = new Sellergoods($this->app);
  18. }
  19. /**
  20. * 三方店铺验证,商品数量,有效期
  21. */
  22. private function checkStore() {
  23. $goodsLimit = (int) $this->store_grade['storegrade_goods_limit'];
  24. if ($goodsLimit > 0) {
  25. // 是否到达商品数上限
  26. $goods_num = model('goods')->getGoodsCommonCount(array('store_id' => session('store_id')));
  27. if ($goods_num >= $goodsLimit) {
  28. ds_json_encode(10001, lang('store_goods_index_goods_limit') . $goodsLimit . lang('store_goods_index_goods_limit1'));
  29. }
  30. }
  31. }
  32. public function goods_class() {
  33. $this->obj->goods_class();
  34. }
  35. public function get_common_data() {
  36. $this->obj->get_common_data();
  37. }
  38. public function save_goods() {
  39. $this->checkStore();
  40. $this->obj->save_goods();
  41. }
  42. public function image_upload() {
  43. $this->obj->image_upload();
  44. }
  45. public function video_upload() {
  46. $this->obj->video_upload();
  47. }
  48. public function add_spec() {
  49. $this->obj->add_spec();
  50. }
  51. public function edit_image() {
  52. $this->obj->edit_image();
  53. }
  54. public function save_image() {
  55. $this->obj->save_image();
  56. }
  57. }
  58. ?>