SettingForm.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. <?php
  2. namespace addons\TinyShop\common\forms;
  3. use addons\TinyShop\common\enums\product\PosteCoverTypeEnum;
  4. use addons\TinyShop\common\enums\product\PosteQrTypeEnum;
  5. use yii\base\Model;
  6. /**
  7. * Class SettingForm
  8. * @package addons\TinyShop\common\forms
  9. * @author jianyan74 <751393839@qq.com>
  10. */
  11. class SettingForm extends Model
  12. {
  13. /***************** 订单配置 *****************/
  14. public $order_auto_delivery = 14;
  15. public $order_buy_close_time = 60;
  16. public $order_not_pay_remind = 0;
  17. public $order_auto_complete_time = 0;
  18. public $order_min_pay_money = 0;
  19. public $order_evaluate = '客户默认好评~';
  20. public $order_evaluate_day = 30;
  21. public $order_after_sale_date = 0;
  22. public $order_oversold = 1;
  23. /***************** 支付配置 *****************/
  24. public $order_balance_pay = 1;
  25. public $order_wechat_pay = 0;
  26. public $order_ali_pay = 0;
  27. public $order_bytedance_pay = 0;
  28. public $order_cash_against_pay = 0;
  29. /***************** 商品设置 *****************/
  30. public $product_audit_status = 0;
  31. /***************** 订单发票 *****************/
  32. public $order_invoice_status = 0;
  33. public $order_invoice_tax = 20;
  34. public $order_invoice_content;
  35. /***************** 物流配送 *****************/
  36. public $logistics = 1;
  37. public $logistics_select = 0;
  38. public $logistics_local_distribution = 0;
  39. public $logistics_pick_up = 0;
  40. public $logistics_local_distribution_type = 1;
  41. /***************** 应用配置 *****************/
  42. public $app_name;
  43. public $app_logo;
  44. public $app_h5_url;
  45. /***************** 会员注册绑定 *****************/
  46. public $member_third_party_binding_type = 0;
  47. public $member_mobile_login_be_register = 0;
  48. public $member_mini_program_register_get_mobile = 0;
  49. public $member_login = 1;
  50. public $member_login_weight = 'account';
  51. public $member_third_party_login = 0;
  52. public $member_register = 1;
  53. public $member_register_promoter_code = 0;
  54. public $member_agreement_default_select = 0;
  55. /***************** 分享配置 *****************/
  56. public $share_title;
  57. public $share_cover;
  58. public $share_desc;
  59. public $share_link;
  60. /***************** 砍价 *****************/
  61. public $bargain = 1;
  62. public $bargain_max_num = 1;
  63. public $bargain_day_max_num = 3;
  64. public $bargain_binding_time = 0;
  65. public $bargain_binding_time_num = 0;
  66. public $bargain_promote_content;
  67. public $bargain_hint;
  68. public $bargain_first_hint;
  69. public $bargain_rule;
  70. /***************** 显示开关 *****************/
  71. public $member_recharge = 1;
  72. public $index_cate = 1;
  73. public $index_decoration = 1;
  74. public $store_entrance = 1;
  75. public $address_select_type = 1;
  76. // App
  77. public $app_service_app_type = 0;
  78. /***************** 系统维护 *****************/
  79. public $site_status = 1;
  80. public $site_close_time;
  81. public $site_close_explain;
  82. /***************** 商品二维码 *****************/
  83. public $product_poster_cover_type = PosteCoverTypeEnum::ROUNDNESS;
  84. public $product_poster_qr_type = PosteQrTypeEnum::COMMON_QR;
  85. public $product_poster_title = '为你挑选了一个好物';
  86. public function rules()
  87. {
  88. return [
  89. [
  90. [
  91. 'order_auto_delivery',
  92. 'order_buy_close_time',
  93. 'order_auto_complete_time',
  94. 'order_min_pay_money',
  95. 'order_evaluate',
  96. 'order_evaluate_day',
  97. 'order_after_sale_date',
  98. 'order_not_pay_remind',
  99. 'order_oversold',
  100. ],
  101. 'required'
  102. ],
  103. [
  104. [
  105. 'order_auto_delivery',
  106. 'order_buy_close_time',
  107. 'order_auto_complete_time',
  108. 'order_min_pay_money',
  109. 'order_evaluate_day',
  110. 'order_after_sale_date',
  111. 'order_not_pay_remind',
  112. 'order_oversold',
  113. ],
  114. 'integer',
  115. 'min' => 0,
  116. ],
  117. [['order_buy_close_time'], 'integer', 'min' => 1],
  118. [['order_evaluate'], 'string'],
  119. [
  120. [
  121. 'order_balance_pay',
  122. 'order_wechat_pay',
  123. 'order_ali_pay',
  124. 'order_min_pay_money',
  125. 'order_bytedance_pay',
  126. 'order_cash_against_pay',
  127. ],
  128. 'integer',
  129. 'min' => 0,
  130. ],
  131. // 支付设置
  132. [
  133. [
  134. 'order_balance_pay',
  135. 'order_wechat_pay',
  136. 'order_ali_pay',
  137. 'order_bytedance_pay',
  138. 'order_cash_against_pay'
  139. ],
  140. 'integer',
  141. ],
  142. // 商品设置
  143. [
  144. [
  145. 'product_audit_status',
  146. ],
  147. 'integer',
  148. ],
  149. // 配送配置
  150. [
  151. [
  152. 'logistics',
  153. 'logistics_select',
  154. 'logistics_pick_up',
  155. 'logistics_local_distribution',
  156. 'logistics_local_distribution_type'
  157. ],
  158. 'integer',
  159. ],
  160. // 发票配置
  161. [['order_invoice_status'], 'integer'],
  162. [['order_invoice_tax'], 'number', 'min' => 0, 'max' => 100],
  163. [['order_invoice_content'], 'string'],
  164. // 会员注册
  165. [
  166. [
  167. 'member_third_party_login',
  168. 'member_login',
  169. 'member_register',
  170. 'member_register_promoter_code',
  171. 'member_third_party_binding_type',
  172. 'member_mobile_login_be_register',
  173. 'member_mini_program_register_get_mobile',
  174. 'member_agreement_default_select',
  175. ],
  176. 'integer',
  177. ],
  178. [['member_login_weight'], 'string'],
  179. // 显示开关
  180. [
  181. [
  182. 'store_entrance',
  183. 'member_recharge',
  184. 'index_cate',
  185. 'index_decoration',
  186. 'address_select_type',
  187. ],
  188. 'integer',
  189. ],
  190. // 应用配置
  191. ['app_h5_url', 'url'],
  192. [['app_name', 'app_logo'], 'string'],
  193. // 分享配置
  194. [['share_title', 'share_cover', 'share_desc', 'share_link'], 'string', 'max' => 200],
  195. // 系统维护
  196. ['site_status', 'integer'],
  197. [
  198. ['site_close_explain'],
  199. 'string',
  200. 'max' => 200,
  201. ],
  202. // 商品二维码
  203. [['product_poster_title'], 'required'],
  204. [['product_poster_title', 'product_poster_cover_type'], 'string', 'max' => 20],
  205. [['product_poster_qr_type'], 'string', 'max' => 30],
  206. ];
  207. }
  208. /**
  209. * @return array
  210. */
  211. public function attributeLabels()
  212. {
  213. return [
  214. 'order_auto_delivery' => '发货后自动收货时间(天)',
  215. 'order_buy_close_time' => '未付款自动关闭时间(分钟)',
  216. 'order_auto_complete_time' => '收货后自动完成时间(天)',
  217. 'order_min_pay_money' => '订单下单最低支付金额',
  218. 'order_not_pay_remind' => '待付款订单催付弹窗',
  219. 'order_oversold' => '超卖订单处理',
  220. 'order_evaluate_day' => '系统默认评价时间(天)',
  221. 'order_after_sale_date' => '完成后可维权时间(天)',
  222. 'order_evaluate' => '默认评价语',
  223. // 支付配置
  224. 'order_balance_pay' => '余额支付',
  225. 'order_wechat_pay' => '微信支付',
  226. 'order_ali_pay' => '支付宝支付',
  227. 'order_bytedance_pay' => '字节跳动支付',
  228. 'order_cash_against_pay' => '货到付款支付',
  229. // 商品设置
  230. 'product_audit_status' => '商品审核',
  231. // 配送设置
  232. 'logistics' => '物流配送',
  233. 'logistics_select' => '选择物流',
  234. 'logistics_cash_delivery' => '货到付款',
  235. 'logistics_local_distribution' => '同城配送',
  236. 'logistics_pick_up' => '买家自提',
  237. 'logistics_local_distribution_type' => '同城配送方式',
  238. // 发票设置
  239. 'order_invoice_status' => '发票',
  240. 'order_invoice_tax' => '发票税率',
  241. 'order_invoice_content' => '发票内容',
  242. // 会员注册
  243. 'member_third_party_binding_type' => '第三方注册绑定设置',
  244. 'member_mini_program_register_get_mobile' => '微信小程序获取手机号码',
  245. 'member_mobile_login_be_register' => '手机验证码登录即注册',
  246. 'member_login_weight' => '默认登录跳转页面',
  247. 'member_login' => '账号密码登录',
  248. 'member_register' => '会员注册',
  249. 'member_third_party_login' => '第三方授权登录',
  250. 'member_register_promoter_code' => '会员注册激活码填写',
  251. 'member_agreement_default_select' => '注册登录协议默认选中',
  252. // 分享配置
  253. 'share_title' => '分享标题',
  254. 'share_cover' => '分享封面',
  255. 'share_desc' => '分享描述',
  256. 'share_link' => '分享链接',
  257. // 应用配置
  258. 'app_name' => '应用名称',
  259. 'app_logo' => '应用 logo',
  260. 'app_h5_url' => '应用 H5 域名',
  261. // 显示开关
  262. 'member_recharge' => '充值入口',
  263. 'index_cate' => '首页顶部分类',
  264. 'index_decoration' => '首页自定义装修',
  265. 'store_entrance' => '店铺入口',
  266. 'address_select_type' => '收货地址省市区选择类型',
  267. ];
  268. }
  269. /**
  270. * @return array
  271. */
  272. public function attributeHints()
  273. {
  274. return [
  275. // 订单设置
  276. 'order_auto_delivery' => '订单多长时间后自动收货,单位为/天 (注:若为0,则订单不会自动收货)',
  277. 'order_min_pay_money' => '订单实际支付金额低于该金额则不允许下单,单位:元',
  278. 'order_buy_close_time' => '订单开始后多长时间未付款自动关闭,单位为/分钟',
  279. 'order_auto_complete_time' => '收货后,多少时间订单自动完成,单位为/天',
  280. 'order_after_sale_date' => '订单完成后,多长时间内可申请维权,设置为0则订单完成后不可维权',
  281. 'order_evaluate_day' => '订单完成达到设置天数后,用户仍未进行评价,则系统进行默认评价',
  282. 'order_oversold' => '出现超卖订单时,订单管理中会标记出此笔订单,可人工选择发货或主动退款关单。也可以选择系统自动退款,需配置退款证书',
  283. // 发票设置
  284. 'order_invoice_tax' => '设置开发票的税率,单位为%',
  285. 'order_invoice_content' => '客户要求开发票时可以选择的内容,逗号分格代表一个选项,例如:办公用品,明细',
  286. // 会员注册
  287. 'member_mini_program_register_get_mobile' => '授权登录后如果发现没有手机号码会强制要求绑定',
  288. 'member_mobile_login_be_register' => '请求手机登录后如果发现用户未注册会直接注册',
  289. // 应用
  290. 'app_h5_url' => '用于后台的商品预览和自定义装修预览',
  291. // 同城配送
  292. 'address_select_type' => '如果选择配送是同城配送需要开启"地图选点"且地址需要重新添加',
  293. ];
  294. }
  295. }
粤ICP备19079148号